Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author HelgaTheViking

    (@helgatheviking)

    Not sure, but I don’t think so? You would need to test and let me know… though I am guessing it’s going to be too complex for me to tackle in the short-term.

    It doesn’t look like it does. I’m exploring WordPress as a replacement to nearing-EoL Drupal 7 for our membership site, partly because of the power of full-site editing. I really need to prevent people seeing menu items not appropriate to their role. This plugin sounded perfect, but neither the site editor nor the dashboard appear to have any way to access it’s features.

    Plugin Author HelgaTheViking

    (@helgatheviking)

    I was going to say that you can still use the default menu admin, but just found out that you cannot! Ugh.

    Given that menus do not change much, I wonder if you could switch to Twenty Twenty, edit your menu, and then choose that menu in the FSE? Does it even work like that? in my own experiment with the FSE over the weekend, I found editing menus very very complicated.

    I did talk to some colleagues who are more fluent in the FSE experience and they’ve informed me it’s not at all possible to add extra fields to the menu items in FSE… even if I wanted to and knew how.

    Thread Starter MartinCV

    (@martin7ba)

    Tried it that way, it doesn’t work. The menu is totally different now and changes everything, at least for the block themes I think.

    Can confirm. Tried switching, created a menu with access settings on it that worked fine, then switched back to Twenty Twenty-Three and the only option for classic menus is to import them, which seems to break the access settings. Every menu item on the imported menu showed up for anonymous users.

    Plugin Author HelgaTheViking

    (@helgatheviking)

    Looks like the menu item setup does run the same function…. wp_setup_nav_menu_item() that the plugin filters…. However with no possibility of adding a block UI, I wouldn’t think there’s a way to set the properties that I am looking for ( $menu_item->display_mode and $menu_item->roles ) that I am looking for later when deciding if the item can show or not.

    It may be possible to manually code this on a site-by-site basis, but it’s hardly ideal. I tried to start with the following, but for some reason, it’s like it doesn’t run in the FSE and I’m not sure yet why.

    /**
     * Hard-code settings on the $item object for Nav Menu Roles to interact with.
     */
    function kia_wp_setup_nav_menu_item( $menu_item ) {
    
    	if ( is_object( $menu_item ) && isset( $menu_item->ID ) ) {
    
    		if ( $menu_item->ID === 99 ) {
    			$menu_item->display_mode = 'show';
    			$menu_item->roles = array( 'administrator' );
    		}
    	}
    	return $menu_item;
    
    }
    add_filter( 'wp_setup_nav_menu_item', 'kia_wp_setup_nav_menu_item', 20 );


Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Does this plugin works with the Block Menus?’ is closed to new replies.