ActionScheduler_DBStore::query_actions
Query for action count or list of action IDs.
Method of the class: ActionScheduler_DBStore{}
No Hooks.
Returns
String|Array|null. The IDs of actions matching the query. Null on failure.
Usage
$ActionScheduler_DBStore = new ActionScheduler_DBStore(); $ActionScheduler_DBStore->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_DBStore::query_actions() ActionScheduler DBStore::query actions code WC 10.3.6
public function query_actions( $query = array(), $query_type = 'select' ) {
/**
* Global.
*
* @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.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.NoSql, WordPress.DB.DirectDatabaseQuery.NoCaching
}