WC_Admin_List_Table_Products::define_columns()
Define which columns to show on this screen.
Метод класса: WC_Admin_List_Table_Products{}
Хуков нет.
Возвращает
Массив
.
Использование
$WC_Admin_List_Table_Products = new WC_Admin_List_Table_Products(); $WC_Admin_List_Table_Products->define_columns( $columns );
- $columns(массив) (обязательный)
- Existing columns.
Код WC_Admin_List_Table_Products::define_columns() WC Admin List Table Products::define columns WC 9.2.3
public function define_columns( $columns ) { if ( empty( $columns ) && ! is_array( $columns ) ) { $columns = array(); } unset( $columns['title'], $columns['comments'], $columns['date'] ); $show_columns = array(); $show_columns['cb'] = '<input type="checkbox" />'; $show_columns['thumb'] = '<span class="wc-image tips" data-tip="' . esc_attr__( 'Image', 'woocommerce' ) . '">' . __( 'Image', 'woocommerce' ) . '</span>'; $show_columns['name'] = __( 'Name', 'woocommerce' ); if ( wc_product_sku_enabled() ) { $show_columns['sku'] = __( 'SKU', 'woocommerce' ); } if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) { $show_columns['is_in_stock'] = __( 'Stock', 'woocommerce' ); } $show_columns['price'] = __( 'Price', 'woocommerce' ); $show_columns['product_cat'] = __( 'Categories', 'woocommerce' ); $show_columns['product_tag'] = __( 'Tags', 'woocommerce' ); $show_columns['featured'] = '<span class="wc-featured parent-tips" data-tip="' . esc_attr__( 'Featured', 'woocommerce' ) . '">' . __( 'Featured', 'woocommerce' ) . '</span>'; $show_columns['date'] = __( 'Date', 'woocommerce' ); return array_merge( $show_columns, $columns ); }