WordPress.org

Support

Support » Plugins and Hacks » If Menu » Customized roles

Customized roles

Viewing 1 replies (of 1 total)
  • The example in the FAQ is fairly incomplete.

    You could add the following to the functions.php of your (child) theme:

    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' );
            }
        );
    
    	return $conditions;
    }

    Note about the “return $conditions;”. That one is missing in the example but is very important!

Viewing 1 replies (of 1 total)
  • The topic ‘Customized roles’ is closed to new replies.
Skip to toolbar