1

I have a custom post type that I am creating custom meta boxes for on the "Add New Post" screen.

I would like to remove the default meta boxes for a given custom taxonomy and place it in a drop down somewhere in a meta box. enter image description here

Currently the code for the fields in the meta box --

    ...
$meta_boxes[] = array(
    'id' => 'slide_meta_box',
    'title' => __('General Property Info', 'framework'),
'context' => 'advanced',
'priority' => 'high',
    'pages' => array('property'),
    'fields' => array(
        array(
            'name' => __('Property ID', 'framework'),
            'id' => $prefix . 'property_site_id',
            'desc' => __("This field will automatically fill, do not edit until required.", 'framework'),
            'clone' => false,
            'type' => 'text',
            'std' => '',
            ),
    // NHB
    array(
                'name' => __('Neighborhood', 'framework'),
                'id' => $prefix . 'property_site_nhb',
                'desc' => __('Select Neighborhood for property.', 'framework'),
                'type' => 'select',
                'options' => get_nhb()
                ),
     // AREA
            array(
                'name' => __('Square Feet', 'framework'),
                'id' => $prefix . 'property_area',
                'desc' => __("Enter the Property SQFT.", 'framework'),
                'clone' => false,
                'type' => 'text',
                'std' => '',
            ),
    ....

And the get_nhb function I tried using --

function get_nhb() {
//wp_nonce_field('get_nhb', 'dropdown-nonce');
    $terms = get_terms( 'neighborhood', 'hide_empty=0');
    $object_terms = wp_get_object_terms( $post->ID, 'neighborhood', array('fields'=>'ids'));
}

What can I do to remove the original taxonomy meta box and place in a drop down?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.