How to add the Edit Shortcuts icon to Wordpress Customizer

How to add the “Edit Shortcuts” icon a new feature in WordPress 4.7 for customization. I want to add this icon anywhere in my theme setting

Wordpress Edit Shortcut icon

+7
wordpress
source share
1 answer

They are called "Visible Editing Shortcuts" in the preview of user preferences. You should read about it here:

https://make.wordpress.org/core/2016/11/10/visible-edit-shortcuts-in-the-customizer-preview/

This is a custom update extension:

$wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'twentyfifteen_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'twentyfifteen_customize_partial_blogdescription', ) ); 

If render callbacks call bloginfo( 'name' ); and bloginfo( 'description' );

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

Also check out the official setup documentation

So, if you have a custom update in your customizer, they will appear by default;)

+1
source share

All Articles