more then one custom condition
-
to have more then one condition, this code worked for me
function conditional_menu($conditions) { $conditions[] = array( 'name' => 'Cond1', // name of the condition 'condition' => function($item) { // callback - must return TRUE or FALSE //check smt if (func() == 'value1') { return TRUE; } else { return FALSE; } } ); $conditions[] = array( 'name' => 'Cond2', // name of the condition 'condition' => function($item) { // callback - must return TRUE or FALSE if (func() == 'value2') { return TRUE; } else { return FALSE; } } ); //and so on... return $conditions; } add_filter( 'if_menu_conditions', 'conditional_menu');
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘more then one custom condition’ is closed to new replies.