The simplest way to disable edit shortcuts without unwanted side effects is to no-op override the JS function that generates them in the first place. You can do this from PHP as follows:
add_action( 'wp_enqueue_scripts', function () {
$js="wp.customize.selectiveRefresh.Partial.prototype.createEditShortcutForPlacement = function() {};";
wp_add_inline_script( 'customize-selective-refresh', $js );
} );
This will work for any theme.
Related Posts:
- New WP_Customize API – how does it work under the hood?
- How to Add Customizer Setting in Child Theme
- customize_register with Multiple controls/settings – how to get values?
- Manipulating post meta in the customizer
- Widgets not working in Customizr but working in Appearance
- In the new Theme Customizer API, how to send a value from the front back to the admin panel?
- get_theme_mod(); returns nothing
- How to get input_attrs in the sanitize function?
- How to change in customizer the “site identity” tab required capabilities
- Customizer image control default value showing in customizer but not on frontend
- Customizer: How do you add HTML to control labels?
- Add new Control to Customizer to modify Headings (h1, h2, h3…) Color
- How to extend nav-menu-item-control data in Appearance > Customize?
- What will happen to the additional CSS when the theme is updated?
- Convert an theme options page to use in customize.php also?
- Add more then one site logo – custom-logo theme support
- Hide devices selection from customizer?
- Fatal error in wp-admin/customize.php after fresh install due to null $wp_customize
- Enabling Additional CSS / custom-css
- Can not sanitize select control in customize api
- Bind JS event to WordPress control customizer
- For a specific theme, how do I build a list of all the possible theme modification names?
- Save & Publish disabled for two dimensional array Customizer
- Allow guests to use WP Customizer but disable save button
- How do I remove a customiser option from a parent theme in a child theme?
- How to add css option to Header Image customizer?
- Trigger Customizer Publish (save) Action
- How to edit alternate inactive themes in “Appearance -> Customise” screen?
- Is it necessary to prefix theme_mod, section id and panel id in the customizer?
- Hide Customizer’s Widget Choices From The List
- theme customizer – can a single option pass multiple values?
- How to remove Customizer’s Section and move Control straight to Panel using Child Theme
- Remove Customizer Control Choices (Type: Radio Array) using Child Themes
- Dynamic Control in customiser
- Is it possible to rename a customizer control heading?
- Is it possible to add custom badges to product attributes conditionally, based on custom field?
- Will WordPress updates remove Gutenberg Additional Classes?
- Easily add custom HTML outside the main container?
- Customizer options limited to specific user roles?
- Can’t Customize WordPress Page
- WordPress Customizer: Check for value of CSS selector and replace it
- In wordpress customizer api adding div wrap to control
- Apply `the_content’ filter to theme customisation live preview
- retrieve theme custom settings
- Multiple Customizers
- Which IDE best for WordPress Development? [closed]
- Refresh Customize Section (not preview)
- Do i need to use PHP in customizer api?
- Where did I put this one line of css?
- Remove wrapping div and ul from output of wp_nav_menu
- Make Custom Metaboxes Collapse by Default
- Need logged in users returing to site redirected to a separate page
- Widgets vs. Theme Mods
- Adding an email column to a Custom Post Types Admin Screen?
- Allow Users to Set Password During Registration
- Print shortcode in custom action hook not where the shortcode is entered
- simple expandable vertical menu, java script problem
- Custom search page and search by title, content and tag
- Best way to integrate an existing PHP application into WordPress
- Adding code to child’s theme css and php cannot override certain elements
- Changing settings of WooCommerce
- How can I stop access of unregistered user in wp-content/uploads directory without using .htaccess file?
- Page content dissapears after loading the page [closed]
- wp_customize set_transient except during preview
- How do you add a table to a site?
- Is there a possiblity to replace profile image gravatar with custom user images
- WooCommerce custom billing fields on email address
- Is there a straight-forward way to provide a meta description tag via Yoast SEO, programmatically, without relying on the admin panel?
- Restrict content access to logged in users
- Custom Form not generating URL
- WordPress Command Question
- getting a 404 page for all pages except home. possibly permalinks
- How do I create a Custom Post Box that Connects Different Posts Together
- Pull Latest Forum Posts within WordPress
- saving the widgets position after drag and drop
- Custom menu not showing even though it shows as being registered?
- Open login logo URL in new tab
- Multisite with subdirectories, and a WordPress installation in a custom folder
- Display all subterms of a custom taxonomy filtered by parent terms
- Migrating my site to a new domain does not keep any changes made in customizer
- how to add custom html and css to wordpress
- Unhook a function within a class in the child theme
- Where to put coding a validation script for store? [duplicate]
- User WordPress menu in custom page
- Class .current-menu-item in custom menu Walker
- Add several fields from different tables to post, fields per post are in same row of table
- Custom folder structure and problem with 3rd party services
- How can I clear the theme mod settings?
- Issue with WordPress native theme customizer function and jquery ui tabs
- add custom css on all page exept of one
- Custom Search Results Page
- Typing and seeing math equations on WordPress site
- Admin new order email customization
- Particle.js not loading in WordPress Gutenberg
- Is it possible to show related posts on WordPress attachment pages?
- How to add filters to my site?
- How to use same username account for multiple users?
- Post does not disappear
- wordpress categories narrow down results
- Why after customizing Home Page, the site is loading six missing blob sources, slowing down all site?