-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
hi
register_rest_field('category', 'custom_fields', array(
'get_callback' => array( $this, 'cat_get_custom_data' ),
'update_callback' => array( $this, 'cat_update_custom_data' ),
'schema' => array(
'description' => 'My custom field',
'type' => 'string',
'context' => array('view', 'edit')
)
)
);
function cat_update_custom_data($value, $post, $field_name) {
}
function cat_get_custom_data($object, $field_name, $request) {
if ( function_exists('get_fields') ) {
return get_fields($object['taxonomy'] . '_' . $object['id']);
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels