ActionScheduler_wpPostStore::mark_failure()
Mark failure on action.
Метод класса: ActionScheduler_wpPostStore{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$ActionScheduler_wpPostStore = new ActionScheduler_wpPostStore(); $ActionScheduler_wpPostStore->mark_failure( $action_id );
- $action_id(int) (обязательный)
- Action ID.
Код ActionScheduler_wpPostStore::mark_failure() ActionScheduler wpPostStore::mark failure WC 9.2.3
public function mark_failure( $action_id ) { /** * Global wpdb object. * * @var wpdb $wpdb */ global $wpdb; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $result = $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->posts} SET post_status = %s WHERE ID = %d AND post_type = %s", self::STATUS_FAILED, $action_id, self::POST_TYPE ) ); if ( false === $result ) { /* translators: %s: action ID */ throw new RuntimeException( sprintf( __( 'Unable to mark failure on action %s. Database error.', 'woocommerce' ), $action_id ) ); } }