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?
- Hover Hide-Visible Additional CSS not working in WordPress website, but shows properly in Customize window
- Is there a blank theme framework compatible with WP 3.0? [closed]
- Plugin SVN & update API – how are plugins identified?
- Custom Search Query
- deleted users still show in count?
- Any amazing WordPress MultiSite sites? [closed]
- Can I create front-end editable user profile pages with WordPress? How do I do it?
- Add a page that appears in the backend admin that lists files to download? WP 3.3
- Multiple Queries and Excluding Repeating Posts?
- get_option issues
- Custom column sorting in WordPress admin post table
- How to get multiple Action Hooks in an Array
- What values can we use in `formattingControls` parameter in RichText component
- Multiple Blogs on one site. Best Practise
- Filter my home page posts by category or by tag
- Custom members area (interface/design) in WordPress, is it possible and how?
- How to get “string” away – replaced with “nothing” [closed]
- Steps for custom data retrieval
- Customizer: active_callback and sanitize_callback incompatibility?
- Remove add news page and posts from menu
- Custom Status of Custom Post type need to EXCLUDE from Taxonomy pages
- Is there a way to use LaTeX formatting for WordPress?
- I’d like to move the Widgets Panel to the bottom of the list in Customizer
- custom default avatar showing broken link
- Custom Log In Screen – Disable password recovery [duplicate]
- How to get every custom taxonomy names and urls?
- Two description meta tags All in One SEO WordPress [closed]
- Create page as a file in my theme?
- Search URL parameters query [duplicate]
- Changing the the_author_posts_link() hover title
- How to add custom ‘layout’ buttons to wordpress editor?
- change top banner content on specific page
- Custom Register Link on Backend Form
- Prevent WordPress from automatically installing a new theme each year
- customer specific email attachment
- How do I run a web app in my WordPress theme without the “wp-content/theme/…/webapp” in URL?
- Use Theme CSS in custom code
- Highly stylized pages
- How should I design subcategory login site?
- How do I change the button text color on my header?
- Replace featured image when shortcode is present
- Execute function with jQuery if widget added or removed?
- Check get_post value after wp-admin login
- My connecting URL form in html to PHP does not work
- Multiple Owl Carousels on the same page with navigation problem
- How to disable jQuery tabs when customizing the theme
- Custom options – register, defaults and delete empty fields (Settings API)
- featured images – custom links
- how can i change the html and the css of my word press theme that I bought?
- Problems with WP 6.1.1 and the get_user_meta() function
- Show last child Child category instead of first child category on page