ActionScheduler_DBStore::query_actions()
Query for action count or list of action IDs.
Метод класса: ActionScheduler_DBStore{}
Хуков нет.
Возвращает
Строку|Массив|null
. The IDs of actions matching the query. Null on failure.
Использование
$ActionScheduler_DBStore = new ActionScheduler_DBStore(); $ActionScheduler_DBStore->query_actions( $query, $query_type );
- $query(массив)
- Query filtering options.
По умолчанию: array() - $query_type(строка)
- Whether to select or count the results.
По умолчанию: select
Заметки
- Смотрите: ActionScheduler_Store::query_actions for $query arg usage.
Список изменений
С версии 3.3.0 | Введена. |
С версии 3.3.0 | $query['status'] accepts array of statuses instead of a single status. |
Код ActionScheduler_DBStore::query_actions() ActionScheduler DBStore::query actions WC 8.7.0
public function query_actions( $query = array(), $query_type = 'select' ) { /** @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 }