I have a dropdown field that displays custom values that I can add from the admin portal. I would like to exclude an option called 'Meal' so it does not show in the dropdown field on the frontend

The code for the options is:

$nvr_propstatuses = nvr_get_option($nvr_shortname.'_property_status');

I have another dropdown field that uses custom taxonomies (see below) and I was able to exclude the specific id by using adding exclude.

$nvr_propertycat    =   'property_category';
$nvr_property_cats  =   get_terms($nvr_propertycat, array( 'exclude' => '5' ) );

Therefore I tried the same approach by using this code but it did not work.

$nvr_propstatuses = nvr_get_option($nvr_shortname.'_property_status', array( 'exclude' => 'Meal' ) );

The dropdown field code is:

<div class="four columns">
    <select id="wdg_filter_status" name="adv_filter_status" class="nvrselector">
        <option value="">-- <?php _e('All', THE_LANG);?> --</option>
        $nvr_optpropstatus = array();
            $nvr_propstatus = $nvr_propstatuses[$i];
            $nvr_optpropstatus[$nvr_propstatus] = $nvr_propstatus;

                $optselected = 'selected="selected"';
                $optselected = '';
                echo '<option value="'. esc_attr( $nvr_propstatus ).'" '.$optselected.'>'.$nvr_propstatus.'</option>';

Any thoughts?


  • what does nvr_get_option() look like? – mrben522 Feb 7 at 16:41

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.