So far the only solution I’ve come up with is creating a function that postMessage
s
the event into the iframe (using customize_controls_enqueue_scripts
hook).
As for the receiver in iframe (hooked on customize_preview_init
hook) I think it could still need some optimization because I’m getting a weird issue with window.addEventListener('message',*
getting some duplicate on customizer loading..
But probably it’s the way it’s supposed to work since i’m using the customize_preview_init
hook twice.
Since I feel their might be better ways any feedback or comment is welcome_
Related Posts:
- Customizer JS API
- Is it Possible to Extend WP Customize JS Methods?
- wp.customize.bind ready event not fired
- Detecting WordPress Customizer Panel
- WP Customizer set a value via javascript (to create presets)
- wp_customize_support_script – do I need it?
- Customizer – instantiating settings and controls via javascript
- Customizer JS API: Defining control settings
- Customizer JS API: Adding Setting Dynamically Not Working
- Customizer: When to use customize_preview_init VS customize_controls_enqueue_scripts
- How to overwrite JS variable with wp_localize _script?
- Theme Customiser not live previewing changes on pseudo elements
- the Customizer – proper way to instantiate an image upload control via javascript
- Preserve Javascript Through Customizer Preview Navigation
- How to check if customize previewer is refreshing?
- JavaScript in WordPress Customizer
- Customizer JS API: Adding a “dropdown-pages” control
- Accessing customizer values in javascript
- Running JS after theme customizer finished initialization
- customize_preview_init: listening for any changes from Customizer preview area
- How to conditionally show/hide controls & sections in WordPress customizer?
- Multiple Conditional Controllers
- WordPress customizer get control
- Using webpack to add customizer live preview functionality – wp.customize is not a function
- Adding and removing hidden buttons from WordPress Customizer Tinymce widget editor using javascript API
- Get a default value of the Customizer setting using wp.customize API (JS)
- How to add customizer control via javascript ( wp.customizer.control.add )
- Load page in customizer preview on panel click?
- Customizer JS API: Defining active_callback for a section
- Adding Code into Theme Customizer Header
- Custom JS text area in customizer is being formatted wrong in document
- customize-controls.js – extend api.previewer
- Multiple jQuery inputs or binds in Customizer Control Javascripts
- Show sections based on a control in WordPress Customizer using JS API
- How do I add a class to Customizer preview based on class of Customizer control? (Customizer Javascript API)
- LayersWP Customizer White Blank Screen
- Get a default customizeAction text for a section using Customizer JS API
- How to get all place details from a Place Details Request using Google Places API Web Service?
- How do I check whether a checkbox is checked in jQuery?
- SyntaxError: Unexpected token o in JSON at position 1
- What does the function then() mean in JavaScript?
- Heroku: “No default language could be detected for this app” error thrown for node app
- Loop inside React JSX
- Can’t resolve module (not found) in React.js
- Is there a difference between /\s/g and /\s+/g?
- Setting a backgroundImage With React Inline Styles
- Filter array to have unique values
- How do I chop/slice/trim off last character in string using Javascript?
- Format JavaScript date as yyyy-mm-dd
- Programmatically change the src of an img tag
- Unable to preventDefault inside passive event listener
- JavaScript variable assignments from tuples
- jQuery $.cookie is not a function
- Setting background-image using jQuery CSS property
- npm WARN … requires a peer of … but none is installed. You must install peer dependencies yourself
- How do I check if string contains substring?
- What does “export default” do in JSX?
- Cannot find module ‘internal/fs’ after upgrading to node 7
- How can I select an element by name with jQuery?
- How can I group data with an Angular filter?
- TypeError: ‘undefined’ is not an object
- Uncaught TypeError: Cannot read property ‘appendChild’ of null
- javascript setTimeout() not working
- JQuery issue “TypeError: $.getJSON is not a function”
- Retrieve the position (X,Y) of an HTML element
- command not found: jest
- How to access Session variables and set them in javascript?
- Google Maps JS API v3 – Simple Multiple Marker Example
- HTML onchange (this.value)
- socket.io – ReferenceError: io is not defined
- What is the difference D3 datum vs. data?
- How to check if a number is between two values?
- How to determine if Javascript array contains an object with an attribute that equals a given value?
- Error: Couldn’t find preset “es2015” relative to directory “/Users/username”
- Using Angular 2 without TypeScript Transpiler
- How to intercept already localized scripts
- How to get the ToggleControl Gutenberg component working for a PHP Block
- How to append a URL parameter to all outbound URLs
- Javascript Helpers
- Rest API invalid nonce with Backbone Client
- Gutenberg block “This block appears to have been modified externally” on save
- site identity section name?
- Enqueue script if screen is greater than 500
- window.send_to_editor throws unterminated string literal error when adding image with multi line description
- Gutenberg get core data – search
- How to use Readmore.js? [closed]
- Trying to turn the Edit function into a class to be able to use React lifecycle methods
- Gutenberg richtext block vaildation failed
- Return ‘X-WP-Total’ from headers in response
- Javascript asset not enqueuing with the rest
- Load content dynamically & resize event
- Taxonomy Template displaying different color post tag js
- Defer Parsing of “createjs.min.js” not working
- Why doesn’t my JS script load?
- Javascript Injection on my WordPress Site
- WordPress Gutenberg Ajax request
- how to refresh page after user logout with ‘wp_logout_url’?
- Trigger a function during onload
- Google AdSense Ad not showing up in WordPress Blog [closed]
- Use add_action to run a script, but only on the post editor page