Show/hide menu items with conditional statements
New conditional statements can be added by any other plugin or theme.
Example of adding a new conditional statement
add_filter( 'if_menu_conditions', 'my_new_menu_conditions' );
function my_new_menu_conditions( $conditions ) {
$conditions[] = array(
'name' => 'If single custom-post-type', // name of the condition
'condition' => function() { // callback - must return TRUE or FALSE
return is_singular( 'my-custom-post-type' );
}
);
}
Requires: 3.0.0 or higher
Compatible up to: 3.4.2
Last Updated: 2012-10-10
Downloads: 2,470
0 of 3 support threads in the last two months have been resolved.
Got something to say? Need help?