• In WP Customizer the following JavaScript error occurs if nav_menus_created_posts setting is removed using the following command:
    $wp_customize->remove_setting( 'nav_menus_created_posts' );

    Uncaught TypeError: Cannot set property ‘_value’ of undefined
    —> api( ‘nav_menus_created_posts’ )._value = [];

    My purpose: I’m using WP Customizer for designing a document template, and I do not need any predefined panel, section, control and setting when this template is customized. They can easily be removed by using the following functions, except nav_menus_created_posts setting:
    $wp_customize->remove_setting
    $wp_customize->remove_control
    $wp_customize->remove_section
    $wp_customize->remove_panel

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator t-p

    (@t-p)

    Have you tried:
    – Flushing any caching plugins you might be running, as well as server and/or browser caches. Not just your browser, but any op cache or content network cache as well such as Cloudflare. If your host provider has a “Purge Varnish” option or if you can ask your provider to flush memcache on your server.
    – deactivating ALL (yes all) plugins temporarily to see if this resolves the problem (plugin functions can interfere). If this works, re-activate them individually (one-by-one) to find the problematic plugin(s).
    manually resetting the plugins folder by FTP/ SFTP (no Dashboard access required). If that resolves the issue, reactivate each one individually until you find the cause. Also remember to deactivate any plugins in the mu-plugins folder (if you have created such folder). The easiest way is to rename that folder to mu-plugins-old.
    – switching to the unedited default Theme (Twenty Sixteen, etc.) for a moment using the WP dashboard to rule out any theme-specific issue (theme functions can interfere like plugins). If you don’t have access to your admin area, use FTP/ SFTP , or your web-host’s cPanel or whatever file management application your host provides (no Dashboard access required). Navigate to /wp-content/themes/ and switch to the default theme by renaming your current theme’s folder by adding “-old” to the end of the folder name. Alternately, you can remove other themes except the default theme. That will force your site to use it.

    Thread Starter kopal

    (@kopal)

    I have tried these, but do not solve the problem.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WP Customizer remove nav_menus_created_posts setting problem’ is closed to new replies.