Automattic\WooCommerce\Blocks\Templates
ArchiveProductTemplatesCompatibility::restore_default_hooks
Restore default hooks except the ones that are not supposed to be re-added.
Method of the class: ArchiveProductTemplatesCompatibility{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->restore_default_hooks();
ArchiveProductTemplatesCompatibility::restore_default_hooks() ArchiveProductTemplatesCompatibility::restore default hooks code WC 10.8.1
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 );
}
}
}
}