2

WordPress 4.5 supposedly enables live refresh of the menu in the customizer, though I cannot get it to work.

If I reorder the menu (in customizer) I see no changes until I perform a manual refresh. However, if I click the Menu Locations checkbox to disable the menu, and again to re-enable, the screen does refresh. Though doing that saves the menu - which is not ideal. Or is that the intended functionality?

Clicking save and publish does not trigger a refresh either. Since other changes in customizer are shown in real time, this seems inconsistent.

Has anyone gotten this to work?

  • I haven't got across this new feature yet, but for clarification, are you developing a theme? Or using an existing one? If so, is this a built in theme or third party? If you're developing, please show the code you're using to attempt to make it work. – Tim Malone Apr 19 '16 at 22:21
  • It is a custom theme. I am using the default menu customizer (not making any changes to default functionality). Menu is pretty standard: $args = array( 'menu' => "Primary", 'depth' => 2, 'container' => 'nav', 'fallback_cb' => '', 'container_class' => 'visible-large primary-menu' ); wp_nav_menu( $args ); – Marcc1213 Apr 19 '16 at 22:25
  • Isn't selective refresh opt in? See make.wordpress.org/core/2016/02/16/… – Tim Malone Apr 19 '16 at 22:28
  • For menus selective refresh should be default. – Marcc1213 Apr 19 '16 at 22:29
0

Selective refresh is only for the items that are selected to cause auto refresh in customizer as explained here:

https://make.wordpress.org/core/2016/02/16/selective-refresh-in-the-customizer/

and here:

https://make.wordpress.org/core/2016/03/22/implementing-selective-refresh-support-for-widgets/

So if the theme developer haven't included this support then you might not see it refresh automatically on save and publish of menu items.

| improve this answer | |
  • As of 4.5 selective refresh is supposed to be enabled by default on menus in customizer - and theme support is also default. – Marcc1213 Apr 20 '16 at 0:01
  • yes but you might still need to add code for it, check this: make.wordpress.org/core/2016/03/22/… – Nabeel Khan Apr 20 '16 at 0:06
0

I found the problem - it was stupid but I hope this helps someone.

I had set the menu using the "menu" arg like so:

 $args = array(
            'menu'   => "Primary", 
  );

For selective refresh to work, you have to use the "theme_location" arg like so:

 $args = array(
            'theme_location'   => "primary", 
        );
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.