What is the name of the setting in the customizer for ‘Display Site Title and Tagline’ checkbox?

Looks like the answer is display_header_text(). I found it in customizer.php in the twentysixteen theme. Relevant code: /** * Styles the header text displayed on the site. * * Create your own twentysixteen_header_style() function to override in a child theme. * * @since Twenty Sixteen 1.0 * * @see twentysixteen_custom_header_and_background(). */ function twentysixteen_header_style() { // … Read more

Customizer live preview not working, refreshes but nothing change

Well, by some experiments, I found the answer. get_theme_mod won’t get you the real-time value when called in ‘after_setup_theme’ or ‘init’, it does work in ‘customize_preview_init’ and ‘wp_loaded’, so the working code: add_action(‘customize_preview_init’, ‘my_header’ ); function my_header() { if(get_theme_mod(‘enable_vertical_header’)) { $vertical_header = new Vertical_Header; } }

How to determine the number of widgets contained in a sidebar via customizer JS

While you can look at the WidgetControl instances contained inside of a SidebarSection, it is better to instead to look at the underlying setting that lists out the widgets contained inside of the sidebar. So do something like this: wp.customize( ‘sidebars_widgets[sidebar-1]’, function( sidebarSetting ) { console.info( sidebarSetting.get().length ); } ); Alternatively, with a reusable function: … Read more

Customizer: widget-synced triggers twice

The reason for this is that the widget will run its update logic on keydown and also on change for a given input element. See https://github.com/WordPress/wordpress-develop/blob/4.7.2/src/wp-admin/js/customize-widgets.js#L891-L907 There are some tradeoffs made when widgets were added to the customizer to bring these PHP-driven interfaces into a JS-driven context. It wasn’t perfect and so this is part … Read more

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