ActionScheduler_wpPostStore::query_actions()
Query for action count or list of action IDs.
Method of the class: ActionScheduler_wpPostStore{}
No Hooks.
Return
String|Array|null
. The IDs of actions matching the query. Null on failure.
Usage
$ActionScheduler_wpPostStore = new ActionScheduler_wpPostStore(); $ActionScheduler_wpPostStore->query_actions( $query, $query_type );
- $query(array)
- Query filtering options.
Default: array() - $query_type(string)
- Whether to select or count the results.
Default: select
Notes
- See: ActionScheduler_Store::query_actions for $query arg usage.
Changelog
Since 3.3.0 | Introduced. |
Since 3.3.0 | $query['status'] accepts array of statuses instead of a single status. |
ActionScheduler_wpPostStore::query_actions() ActionScheduler wpPostStore::query actions code WC 9.3.3
public function query_actions( $query = array(), $query_type = 'select' ) { /** * Global $wpdb object. * * @var wpdb $wpdb */ global $wpdb; $sql = $this->get_query_actions_sql( $query, $query_type ); return ( 'count' === $query_type ) ? $wpdb->get_var( $sql ) : $wpdb->get_col( $sql ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.NotPrepared }