Automattic\WooCommerce\Blocks\Templates

ArchiveProductTemplatesCompatibility::restore_default_hooks()privateWC 1.0

Restore default hooks except the ones that are not supposed to be re-added.

Method of the class: ArchiveProductTemplatesCompatibility{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->restore_default_hooks();

ArchiveProductTemplatesCompatibility::restore_default_hooks() code WC 9.6.0

private function restore_default_hooks() {
	foreach ( $this->hook_data as $hook => $data ) {
		if ( ! isset( $data['hooked'] ) ) {
			continue;
		}
		foreach ( $data['hooked'] as $callback => $priority ) {
			if ( ! in_array( $callback, $data['permanently_removed_actions'] ?? array(), true ) ) {
				add_action( $hook, $callback, $priority );
			}
		}
	}
}