WP_Customize_Setting::suspend_option_preview
Suspends previewing the setting's option, so that its preview filters pass through the original value.
This is done while the option is being sanitized or saved. Every call must be paired with a call to WP_Customize_Setting::resume_option_preview(), including when an exception or error is thrown.
Method of the class: WP_Customize_Setting{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->suspend_option_preview();
Changelog
| Since 7.1.5 | Introduced. |
WP_Customize_Setting::suspend_option_preview() WP Customize Setting::suspend option preview code WP 7.1.5
private function suspend_option_preview() {
/** @var string $id_base */
$id_base = $this->id_data['base'];
if ( ! isset( self::$suspended_option_previews[ $id_base ] ) ) {
self::$suspended_option_previews[ $id_base ] = 1;
} else {
++self::$suspended_option_previews[ $id_base ];
}
}