DTD For Category only | WordPress.org

[ad_1]

Hi,
you can disable the DTD for the advert_location field in the [adverts_add] shortcode or the Classifieds / Publish block by adding the code below in your theme functions.php file


add_filter( "dependant_taxonomy_dropdown_get", function( $dtd ) {
    unset( $dtd["advert"]["adverts_location"] );
    return $dtd;
} );

or just open the file dependant-taxonomy-dropdown.php and remove from it the line


"adverts_location" => array( "taxonomy" => "advert_location", "rename_to" => "advert_location" )

Hello Greg

I used the filter code but the dtd did not deactivate for location in the advert search form.
It only worked in the advert add form

I figured this out by adding below

unset( $dtd["search"]["location"] );

Thanks this is now resolved

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer