Action hook 'customize_preview_{$this->id}'

in WP Core File wp-includes/class-wp-customize-setting.php at line 405

View Source

customize_preview_{$this->id}

Action Hook
Description
Fires when the WP_Customize_Setting::preview() method is called for settings not handled as theme_mods or options. The dynamic portion of the hook name, `$this->id`, refers to the setting ID.

Hook Information

File Location wp-includes/class-wp-customize-setting.php View on GitHub
Hook Type Action
Line Number 405

Hook Parameters

Type Name Description
WP_Customize_Setting $setting WP_Customize_Setting instance.

Usage Examples

Basic Usage
<?php
// Hook into customize_preview_{$this->id}
add_action('customize_preview_{$this->id}', 'my_custom_function', 10, 1);

function my_custom_function($setting) {
    // Your custom code here
}

Source Code Context

wp-includes/class-wp-customize-setting.php:405 - How this hook is used in WordPress core
<?php
 400  				 *
 401  				 * @since 3.4.0
 402  				 *
 403  				 * @param WP_Customize_Setting $setting WP_Customize_Setting instance.
 404  				 */
 405  				do_action( "customize_preview_{$this->id}", $this );
 406  
 407  				/**
 408  				 * Fires when the WP_Customize_Setting::preview() method is called for settings
 409  				 * not handled as theme_mods or options.
 410  				 *

PHP Documentation

<?php
/**
				 * Fires when the WP_Customize_Setting::preview() method is called for settings
				 * not handled as theme_mods or options.
				 *
				 * The dynamic portion of the hook name, `$this->id`, refers to the setting ID.
				 *
				 * @since 3.4.0
				 *
				 * @param WP_Customize_Setting $setting WP_Customize_Setting instance.
				 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/class-wp-customize-setting.php
Related Hooks

Related hooks will be displayed here in future updates.