ActionScheduler_Abstract_ListTable::get_items_query_filters()protectedWC 1.0

Prepares the SQL to filter rows by the options defined at $this->filter_by. Before trusting any data sent by the user it validates that it is a valid option.

Метод класса: ActionScheduler_Abstract_ListTable{}

Хуков нет.

Возвращает

null. Ничего (null).

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_items_query_filters();

Код ActionScheduler_Abstract_ListTable::get_items_query_filters() WC 8.7.0

protected function get_items_query_filters() {
	global $wpdb;

	if ( ! $this->filter_by || empty( $_GET['filter_by'] ) || ! is_array( $_GET['filter_by'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
		return '';
	}

	$filter = array();

	foreach ( $this->filter_by as $column => $options ) {
		if ( empty( $_GET['filter_by'][ $column ] ) || empty( $options[ $_GET['filter_by'][ $column ] ] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
			continue;
		}

		$filter[] = $wpdb->prepare( "`$column` = %s", sanitize_text_field( wp_unslash( $_GET['filter_by'][ $column ] ) ) ); //phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
	}

	return implode( ' AND ', $filter );

}