Import settings from another theme

Well, you can read the core code to find the actions, or you can use a debugging method to find the one you need. Put into wp-config.php: define(‘WP_DEBUG’, true); define( ‘WP_DEBUG_LOG’, true ); Then make a mu-plugin file containing: <?php add_action( ‘all’, ‘_action_printer’ ); function _action_printer( $a ){ if (strpos(‘gettext’, $a) === false && strpos(‘escape’, … Read more

Location of customizer Menu panel core code

The logic to dynamically add new sections is pretty straightforward with the JS API (and will be even more so in the upcoming 4.9 release). For dynamically adding new nav menu sections, see the relevant logic in wp.customize.Menus.NewMenuControl.prototype.submit. Another example you can refer to is in the Customize Posts plugin which adds sections dynamically for … Read more

How to implement Selective Refresh within posts?

Yes, it is possible. In fact, look at the Customize Posts plugin where selective refresh of partials for title, content, excerpt, featured image, etc is implemented. You’ll note that it depends on the settings for posts being registered dynamically along with the partials for each post. The setting ID must be variable and contain a … Read more

Debugging slow WordPress Theme Customizer (Any option similar to Query Monitor)?

It turns out Query Monitor is, in fact, present in Customizer view. For some reason, I never once scrolled down to the bottom (or just didn’t pay attention). Just the debug/admin bar is not visible. Also, you can do this to get the admin bar in theme customizer: add_filter(‘show_admin_bar’, ‘__return_true’); Source Another useful tool is … Read more

Get a default customizeAction text for a section using Customizer JS API

You’re right. There’s currently no default value for the customizeAction param. You can add your own default value for all controls with something like this in PHP: add_action( ‘customize_controls_enqueue_scripts’, function() { wp_add_inline_script( ‘customize-controls’, sprintf( ‘wp.customize.Section.prototype.defaults.customizeAction = %s;’, wp_json_encode( __( ‘Customizing’, ‘default’ ) ) ) ); } ); This isn’t in core yet because the default … Read more

Customizer doesn’t recognise sidebar

I found out what the problem was. I were using jQuery in the wrong way, which made the customizer fail. This is how you should enqueue a script with jQuery: function my_theme_scripts() { wp_enqueue_script( ‘my-great-script’, get_template_directory_uri() . ‘/js/my-great-script.js’, array( ‘jquery’ ), ‘1.0.0’, true ); } add_action( ‘wp_enqueue_scripts’, ‘my_theme_scripts’ ); See more on this page.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)