Description
Register a field named $field_name for object type $object_type
Usage
bw_register_field_for_object_type( $field_name, $object_type, $rest );Parameters
- $field_name
- ( string ) required – meta_key of the field – precede with an underscore so it's not in custom fields
- $object_type
- ( string ) required – object type
- $rest
- ( bool ) optional – true for fields to be available to the REST api
Returns
voidTO DO
determine if this works for "taxonomy" field types as wellSource
File name: oik/includes/bw_register.phpLines:
1 to 8 of 8
function bw_register_field_for_object_type( $field_name, $object_type, $rest=false ) { global $bw_mapping; $bw_mapping['field'][$object_type][$field_name] = $field_name; $bw_mapping[bw_maybe_register_post_meta][$field_name][$object_type] = $object_type; if ( $rest ) { bw_maybe_register_post_meta( $field_name, $object_type ); } }View on GitHub View on Trac
Called by
1 to 4 of 4
- Tests_issue_2::test_bw_custom_column_admin_field_for_post_type() – Here we should produce some output – displaying the field value for "field" for the selected post ID
- Tests_issue_2::test_bw_custom_column_admin_field_not_for_post_type() – bw_custom_column_admin is an action hook which should be invoked by an action with generic name "manage_${post_type}_posts_custom_column"
- Tests_issue_2::test_bw_field_registered_for_object_type() –
- Tests_issue_2::test_bw_register_field_for_object_type() –
