Abstract_WC_Order_Data_Store_CPT::restore_transactional_email_dispatch
Restores the transactional email dispatch listeners previously neutralized by {@see suspend_transactional_email_dispatch()} to their original callbacks.
Метод класса: Abstract_WC_Order_Data_Store_CPT{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->restore_transactional_email_dispatch( $suspended ): void;
- $suspended(массив) (обязательный)
- .
Список изменений
| С версии 10.9.0 | Введена. |
Код Abstract_WC_Order_Data_Store_CPT::restore_transactional_email_dispatch() Abstract WC Order Data Store CPT::restore transactional email dispatch WC 11.2.2
protected function restore_transactional_email_dispatch( array $suspended ): void {
global $wp_filter;
foreach ( $suspended as $entry ) {
list( $action, $priority, $key, $function ) = $entry;
if ( ! isset( $wp_filter[ $action ] ) || ! $wp_filter[ $action ] instanceof WP_Hook ) {
continue;
}
// Only restore the slot if it still exists; if it was removed during the
// suspended window we must not resurrect it.
if ( ! isset( $wp_filter[ $action ]->callbacks[ $priority ][ $key ] ) ) {
continue;
}
$wp_filter[ $action ]->callbacks[ $priority ][ $key ]['function'] = $function;
}
}