ActionScheduler_wpPostStore::cancel_action()
Cancel action.
Метод класса: ActionScheduler_wpPostStore{}
Хуки из метода
Возвращает
null
. Ничего.
Использование
$ActionScheduler_wpPostStore = new ActionScheduler_wpPostStore(); $ActionScheduler_wpPostStore->cancel_action( $action_id );
- $action_id(int) (обязательный)
- Action ID.
Код ActionScheduler_wpPostStore::cancel_action() ActionScheduler wpPostStore::cancel action WC 7.7.2
public function cancel_action( $action_id ) { $post = get_post( $action_id ); if ( empty( $post ) || ( self::POST_TYPE !== $post->post_type ) ) { /* translators: %s is the action ID */ throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) ); } do_action( 'action_scheduler_canceled_action', $action_id ); add_filter( 'pre_wp_unique_post_slug', array( $this, 'set_unique_post_slug' ), 10, 5 ); wp_trash_post( $action_id ); remove_filter( 'pre_wp_unique_post_slug', array( $this, 'set_unique_post_slug' ), 10 ); }