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]
- Passing a parameter to filter and action functions
- Get a list of all registered actions
- How can I edit post data before it is saved?
- How can I see all the actions attached to an “add_action” hook?
- Where is the best place to use add_filter
- How can I make it so the Add New Post page has Visibility set to Private by default?
- Deactivate plugin for a specific user group
- Auto Load Plugin Hooks inside Must Use Plugin
- How to only hook on Single.php after content?
- InDesign to WordPress workflow
- Removing an action from an external plugin class
- When can you get current page ID and initialize hooks right after?
- Prevent publishing the post before setting a featured image?
- 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?
- WordPress admin notice in plugin function
- Using the ‘draft_to_publish’ hook (post status transition)
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- How can I limit functionality in one version of a plugin?
- Is there a global action for when a plugin is uninstalled?
- Shortcode display outside the div
- Which hook callback has priority if both plugin and theme use the same hook?
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- Publish Post After Click On A Link
- Use external link in the add sub menu
- How to remove action from plugin?
- delay function on publish?
- Very stubborn wp_register_script / add_action vs remove
- How to prepend to the_title for admin-side plugin’s use
- How can I enqueue a style only when a particular widget is active?
- Add custom buttons with custom actions in Edit Post screen in WordPress?
- do_action and hook methods
- Can a plugin add to header/footer/body content?
- 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 filter content post only on save
- Filter or action hook to insert content on admin pages before tag
- Is it possible to remove this action? (as it’s added just before it’s called)
- HELP: Integrating WP with raw PHP code once published button is hit
- How to add inline css/js inside a shortcode
- WordPress Plugin Boilerplate – add_action hook in static “activate” function
- How to call bind function in wordpress actions or hooks
- Display future posts?
- How to prevent action in ajax request, when in admin side?
- What is the purpose of $merged_filters?
- template_redirect not being called when using ajax
- add action wp_head not working
- Hide Theme options and Customize Admin menu
- Can I use a method from an existing plugin as an action hook?
- Plugin custom Action Hook not working
- What are the benefit in adding hook in the init() hook?
- How to integrate plugin in WordPress theme
- add_action in functions.php, do_action in plugin?
- Detect when any plugin is activated or deactivated
- add action for displaying posts using a shortcode
- ‘wp_login’ action hook not working with wp-login.php file
- Where to hook my plugin’s action
- Overwrite or Replace code in WP_Footer
- How to embed HTML code from WP Coder plugin (or other) into Main Index Template of the theme
- How to add a default value to get_option if it’s used as a variable?
- How to Use Parameters with a Do_Action Function Within PHP Tags
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- WordPress filter that hook after each action/filter hook
- How to stop or remove an action being called inside a function of an extended class
- Get posts from WP_Query and format them on admin_head
- Automatically add attributes to woocommerce product?
- How to Display a Plugin function (content) on frontpage using index.php
- Any hook for pre-plugin-update -either bulk or single plugin update
- wordpress plugin is not activating from widget
- Insert new user with form submit ‘init’ hook
- When to load auto-login code?
- How to get all of the activate_plugin action parameters?
- Calling plugin function inside custom plugin for onclick event
- How to check current user before all actions and filters?
- Plugin options page with live preview?
- CampaignMonitor for WooCommerce – Move subscribe button [closed]
- 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
- Plugin developer automated documentation
- Custom plugin init action causing general slowness
- Is there a hook to Intercept al urls from a webpage and redirect to a page
- add_action in static class [closed]
- 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
- Submit custom form from post content and execute in plugin
- Inject HTML meta tag inside wordpress tag using add_shortcode
- How to get post ID with hooks publish_post, new_to_publish, etc
- add_action in a custom plugin
- register_activation_hook in oop approach
- What is @Action in WordPress?
- Problem with removing plugin action
- edit_user_profile and show_user_profile are not firing inside a class
- Add action to fire when a published post is updated