ActionScheduler_wpPostStore::unclaim_action()publicWC 1.0

Unclaim action.

{} Это метод класса: ActionScheduler_wpPostStore{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$ActionScheduler_wpPostStore = new ActionScheduler_wpPostStore();
$ActionScheduler_wpPostStore->unclaim_action( $action_id );
$action_id(строка) (обязательный)
Action ID.

Код ActionScheduler_wpPostStore::unclaim_action() WC 6.9.4

public function unclaim_action( $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_password = '' WHERE ID = %d AND post_type = %s",
			$action_id,
			self::POST_TYPE
		)
	);
	if ( false === $result ) {
		/* translators: %s: action ID */
		throw new RuntimeException( sprintf( __( 'Unable to unlock claim on action %s. Database error.', 'woocommerce' ), $action_id ) );
	}
}