Snippets: Hide Menu Search When Using Custom Menus

// Disables the search in the menu when a custom menu is being used on the page
function myprefix_menu_search_display() {
	if ( get_post_meta( get_the_ID(), 'wpex_custom_menu', true ) ) {
		return false;
	} else {
		return true;
	}
}
add_filter( 'wpex_has_menu_search', 'myprefix_menu_search_display' );

Snippet Type: PHP

Posted Under: Menu

All PHP snippets should be added via a child theme's functions.php file.