ActionScheduler_wpPostStore::release_claim()
Release claim.
Method of the class: ActionScheduler_wpPostStore{}
No Hooks.
Return
null
. Nothing (null).
Usage
$ActionScheduler_wpPostStore = new ActionScheduler_wpPostStore(); $ActionScheduler_wpPostStore->release_claim( $claim );
- $claim(ActionScheduler_ActionClaim) (required)
- Claim object to release.
ActionScheduler_wpPostStore::release_claim() ActionScheduler wpPostStore::release claim code WC 8.7.0
public function release_claim( ActionScheduler_ActionClaim $claim ) { $action_ids = $this->find_actions_by_claim_id( $claim->get_id() ); if ( empty( $action_ids ) ) { return; // nothing to do. } $action_id_string = implode( ',', array_map( 'intval', $action_ids ) ); /** * 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 IN ($action_id_string) AND post_password = %s", //phpcs:ignore array( $claim->get_id(), ) ) ); if ( false === $result ) { /* translators: %s: claim ID */ throw new RuntimeException( sprintf( __( 'Unable to unlock claim %s. Database error.', 'woocommerce' ), $claim->get_id() ) ); } }