Contents
On this page

Delete Custom Field - Plugixa Team

DELETE /plugixateam/v1/custom-fields/{id}

Delete a custom field definition, and with it the value every member had for it.

Needs Plugixa Team Pro. Needs the plugixa_team_settings capability, which only administrators get on activation, or manage_options. Editors fill these fields in on members but cannot change the definitions.

Note. Deleting the field also deletes every member’s stored value for its key, for good. The one exception is a translated field on a WPML or Polylang site: while another language’s definition still uses the same key, the values are kept.

Request

DELETE https://your-site.example/wp-json/plugixateam/v1/custom-fields/4

Path parameters

Name Type Description
id integer The field’s id

Responses

200 OK. The field was deleted.

{
  "success": true,
  "message": "Custom field deleted successfully",
  "data": null
}
Field Type Meaning
data null Nothing is returned

Errors

Status Code When
404 rest_error No field with that id.
404 rest_no_route The site runs the free build.
500 rest_error The database refused the delete.

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixateam/v1/custom-fields/4" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixateam/v1/custom-fields/4');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixateam/v1/custom-fields/4', {
  method: 'DELETE',
  headers: {
    'Authorization': `Basic ${auth}`,
  },
});
const { data } = await response.json();

Quick Links

Share