theme-customization

Today after updating my site to latest WordPress  version 4.5. i came along this issue. My customizer  preview init is totally blank with no section and panel. Along with i got this error on console

Uncaught TypeError: data.defaultValue.substring is not a function

How i solved this issue?

  • First I deactivated all plugin installed on a site to see if plugin is creating issue.
  • Then I dequeue  all the scripts from functions.php as well from customizer file where theme had added for creating customizer setting. To make sure which file is creating conflict i tried by removing file sequentially that is added on functions.php
  • After I found that the file where customizer setting for control,setting, panel and section is causing the problem.
  • Then to know if setting id is creating conflict i tried by changing all section id to different value then tracking one by one.
  • Finally I found setting id “widget_titles” is creating problems and changed to some XXXX id which solve the issue

After debugging for 3 hour finally i found the solution of the problems.

Conclusion: Always name options id,setting id and  , functions  prefixing with theme or plugin slug. It will prevents your id conflicting to other third party or WordPress core itself.

Thanks

Sushil Adhikari

Advertisements