If Menu
Customized roles (2 posts)

  1. danicasati
    Posted 3 years ago #

    I put customized rules on my website, but they can't display in conditions.
    How can I add customized roles to dropdown menu?


  2. BramNL
    Posted 3 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • If Menu
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic