astra_detach_option_filters()

Detach all pre_option_ / option_ filters registered for astra-settings.


Description


Return

(array) Detached hooks, keyed by hook name. Pass to astra_restore_option_filters().


Source

File: classes/astra-common-functions.php

	function astra_detach_option_filters() {
		global $wp_filter;

		$hooks    = array( 'pre_option_' . ASTRA_THEME_SETTINGS, 'option_' . ASTRA_THEME_SETTINGS );
		$detached = array();

		foreach ( $hooks as $hook ) {
			if ( isset( $wp_filter[ $hook ] ) ) {
				$detached[ $hook ] = $wp_filter[ $hook ];
				unset( $wp_filter[ $hook ] );
			}
		}

		return $detached;
	}

Changelog

Changelog
Version Description
4.13.7 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.