custom-metadata icon indicating copy to clipboard operation
custom-metadata copied to clipboard

'include' paramater doesn't work for groups

Open jkudish opened this issue 13 years ago • 1 comments

With latest WordPress (3.3.1 and 3.4-alpha). The paramater works for individual fields but not for groups

jkudish avatar Feb 16 '12 05:02 jkudish

Does the 'include' parameter work for fields inside of a multifield?

I have a multifield that belongs to two different post types. Inside of the multifield, I want to include a specific field inside of only one of the post types.

So essentially I have:

x_add_metadata_field( 'canadian_medallists_sport', array('games', 'sports'), array(
        'group' => 'medallists_options_metabox_group',
        'multifield' => 'canadian_medallists',        
        'label' => 'Sport',
        'field_type' => 'text',
        'include' => 'canadian_medallists_sport_callback',       
) );

function canadian_medallists_sport_callback( $thing_slug, $thing, $object_type, $object_id, $object_slug ) {
        return  'games' == get_post_type( $object_id );
}

However this does not seem to work.

trewknowledge avatar Dec 19 '13 17:12 trewknowledge