Automattic\WooCommerce\Admin\API\Reports
DataStore::selected_columns()
Returns a list of columns selected by the query_args formatted as a comma separated string.
Метод класса: DataStore{}
Хуков нет.
Возвращает
Строку
.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->selected_columns( $query_args );
- $query_args(массив) (обязательный)
- User-supplied options.
Код DataStore::selected_columns() DataStore::selected columns WC 9.8.1
protected function selected_columns( $query_args ) { $selections = $this->report_columns; if ( isset( $query_args['fields'] ) && is_array( $query_args['fields'] ) ) { $keep = array(); foreach ( $query_args['fields'] as $field ) { if ( isset( $selections[ $field ] ) ) { $keep[ $field ] = $selections[ $field ]; } } $selections = implode( ', ', $keep ); } else { $selections = implode( ', ', $selections ); } return $selections; }