Unfortunately there is no official hook for customizer actions yet. Since the customizer actions are predefined by javascript, you can use the The Customizer JavaScript API to add new actions via the push
function.
PHP function for the index.php/functions.php:
// Include scripts in customizer.
add_action( 'customize_controls_enqueue_scripts', 'script' );
function script() {
wp_enqueue_script( 'custom-customize-controls', plugin_dir_url( __FILE__ ) . 'customizer.js', [], null, true );
}
and the framework customizer.js file…
;(function (api) {
api.bind('ready', function () {
api.settings.changeset.statusChoices.push({"status":"action","label":"Action"});
});
})(wp.customize);
Does this option work for you?
Related Posts:
- Action on post publish
- how to execute some code after a post is published in WordPress [duplicate]
- How can I edit post data before it is saved?
- How to only hook on Single.php after content?
- How can I log a user out of WordPress before the page loads?
- What is the ‘admin_action_’ . $_REQUEST[‘action’] hook used for?
- Autogenerate wordpress shortcodes using array?
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Is there a global action for when a plugin is uninstalled?
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- Publish Post After Click On A Link
- How to remove action from plugin?
- Very stubborn wp_register_script / add_action vs remove
- do_action and hook methods
- Is it possible to add an action to the currently running action?
- Is there an action that is called when a post is restored from the trash?
- Peer Review Plugin for Posts? [closed]
- How to add inline css/js inside a shortcode
- How to prevent action in ajax request, when in admin side?
- What is the purpose of $merged_filters?
- Hide Theme options and Customize Admin menu
- Can I use a method from an existing plugin as an action hook?
- What are the benefit in adding hook in the init() hook?
- How to integrate plugin in WordPress theme
- Detect when any plugin is activated or deactivated
- Where to hook my plugin’s action
- Overwrite or Replace code in WP_Footer
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- Get posts from WP_Query and format them on admin_head
- Any hook for pre-plugin-update -either bulk or single plugin update
- wordpress plugin is not activating from widget
- When to load auto-login code?
- How to get all of the activate_plugin action parameters?
- Plugin options page with live preview?
- Get Time Taken By Each Action Hook in WordPress
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Removing an action from wp_footer called in a class that’s inside a bigger class
- WordPress user account activation
- WordPress plugin admin html being shown in Customizer iframe
- External Script Using WP – Hooks / Actions Not Working?
- remove add new post, if there is already one post
- add_action in a custom plugin
- What is @Action in WordPress?
- Add action to fire when a published post is updated
- _prime_post_caches in wordpress
- add_action into another add_action not working
- Run a plugin just ‘once’ per page reload
- Using add_action before add_filter on a plugin?
- a weird attribute on every html tag
- Submit Form data to another page via Ajax (WordPress Way)
- Why do plugins often ask to add in to templates?
- remove_action not removing add_action from constructor
- How to get menu location in wp_update_nav_menu hook
- Advanced WordPress plugin activation detection
- How to remove products-links after the product title using remove_action
- How to customize this theme? [closed]
- trigger email when post is published by someone a user follows
- Add action to custom Function
- Overwrite add_image_size defined by theme
- WordPress API functions not working at AJAX functions.php call
- wp_ajax action responds with 0
- Custom CSS not being added by plugin
- How to use add_action for multiple instances of the same class
- How to hook into action/filter call
- I cannot include a file in my plugin settings page
- Edit post image attributes on fly?
- Elementor Sidebar not loading when PRO elements plugin is active
- dokan edit functionality
- Why do actions with class and public method don’t fire __construct()
- Sharing varible between two add_actions
- How to remove default action from a plugin?
- Removing Plugin Action via Theme for Non-admins
- when i activate my WordPress plugin cannot see customizer options or preview
- Get post content inside plugin class method
- WordPress appearance button
- Ajax call to php function doesn’t work PHP code
- how to add navigation icons in specific template?
- Frontend AJAX Request causes Error: ‘Call to undefined function add_action’
- Customizer preview URL not updating when settings reset to default
- Creating Admin Submenu Page via Class Method
- Help needed with woocommerce (wc stripe) filter
- How to add separator between default and custom panels in WordPress customizer?
- Why doesn’t a form need an ‘action’ with a plugin that uses the post data?
- Run only on plug-in activation instead of wp_head
- Am I using an action hook correctly?
- plugins_loaded action is not working properly
- AJAX login without a plugin does not work. when add a action to function.php
- Remove action working on functions.php but not in a plugin. Why?
- add_media_page function not creating submenu
- change output location of plugin function using a custom hook
- disable lightbox in a plugin [closed]
- Remove action plugin
- Filter for modifying image on upload
- add query string to all pages after user logged in
- How wordpress plugin hooks works? [duplicate]
- Hook automatic_updates_complete to autoupdate plugin
- My wp_update_nav_menu action is firing twice
- Real estate schema markup not showing up on Rich Results test
- Issue with customizer and widget page
- ImageMagick on wordpress 6.5.5 for Linux Alma 8 success but which no magick