WPSEO_Meta_Columns::column_sort_orderby
Modify the query based on the filters that are being passed.
Метод класса: WPSEO_Meta_Columns{}
Хуки из метода
Возвращает
Массив. Array containing the meta query to use for filtering the posts overview.
Использование
$WPSEO_Meta_Columns = new WPSEO_Meta_Columns(); $WPSEO_Meta_Columns->column_sort_orderby( $vars );
- $vars(массив) (обязательный)
- Query variables that need to be modified based on the filters.
Код WPSEO_Meta_Columns::column_sort_orderby() WPSEO Meta Columns::column sort orderby Yoast 26.3
public function column_sort_orderby( $vars ) {
$collected_filters = $this->collect_filters();
$order_by_column = $vars['orderby'];
if ( isset( $order_by_column ) ) {
// Based on the selected column, create a meta query.
$order_by = $this->filter_order_by( $order_by_column );
/**
* Adapt the order by part of the query on the posts overview.
*
* @internal
*
* @param array $order_by The current order by.
* @param string $order_by_column The current order by column.
*/
$order_by = apply_filters( 'wpseo_change_order_by', $order_by, $order_by_column );
$vars = array_merge( $vars, $order_by );
}
return $this->build_filter_query( $vars, $collected_filters );
}