WooCommerce Code Reference

WC_Admin_List_Table_Products extends WC_Admin_List_Table
in package

WC_Admin_List_Table_Products Class.

Table of Contents

$list_table_type  : string
Post type.
$object  : object|null
Object being shown on the row.
__construct()  : mixed
Constructor.
add_custom_query_var()  : array
Query vars for custom searches.
add_variation_parents_for_shipping_class()  : array
Modifies post query so that it includes parent products whose variations have particular shipping class assigned.
default_hidden_columns()  : array
Adjust which columns are displayed by default.
define_bulk_actions()  : array
Define bulk actions.
define_columns()  : array
Define which columns to show on this screen.
define_sortable_columns()  : array
Define which columns are sortable.
disable_view_mode()  : array
Removes this type from list of post types that support "View Mode" switching.
filter_downloadable_post_clauses()  : array
Filter by type.
filter_stock_status_post_clauses()  : array
Filter by stock status.
filter_virtual_post_clauses()  : array
Filter by type.
handle_bulk_actions()  : string
Handle bulk actions.
list_table_primary_column()  : string
Set list table primary column.
maybe_render_blank_state()  : mixed
Show blank slate.
order_by_price_asc_post_clauses()  : array
Handle numeric price sorting.
order_by_price_desc_post_clauses()  : array
Handle numeric price sorting.
order_by_sku_asc_post_clauses()  : array
Handle sku sorting.
order_by_sku_desc_post_clauses()  : array
Handle sku sorting.
posts_clauses()  : array
Undocumented function
product_views()  : array
Change views on the edit product screen.
remove_ordering_args()  : array
Remove ordering queries.
render_columns()  : mixed
Render individual columns.
render_products_stock_status_filter()  : mixed
Render the stock status filter for the list table.
request_query()  : array
Handle any filters.
restrict_manage_posts()  : mixed
See if we should render search filters or not.
row_actions()  : array
Set row actions.
search_label()  : string
Change the label when searching products
sku_search()  : string
Search by SKU or ID for products.
define_hidden_columns()  : array
Define hidden columns.
get_primary_column()  : string
Define primary column.
get_row_actions()  : array
Get row actions to show in the list table.
prepare_row_data()  : mixed
Pre-fetch any data for the row each column has access to it. the_product global is there for bw compat.
query_filters()  : array
Handle any custom filters.
render_blank_state()  : mixed
Render blank state.
render_featured_column()  : mixed
Render columm: featured.
render_filters()  : mixed
Render any custom filters and search inputs for the list table.
render_is_in_stock_column()  : mixed
Render columm: is_in_stock.
render_name_column()  : mixed
Render column: name.
render_price_column()  : mixed
Render columm: price.
render_product_cat_column()  : mixed
Render columm: product_cat.
render_product_tag_column()  : mixed
Render columm: product_tag.
render_products_category_filter()  : mixed
Render the product category filter for the list table.
render_products_type_filter()  : mixed
Render the product type filter for the list table.
render_sku_column()  : mixed
Render columm: sku.
render_thumb_column()  : mixed
Render columm: thumb.
append_product_sorting_table_join()  : string
Join wc_product_meta_lookup to posts if not already joined.

Properties

Methods

add_variation_parents_for_shipping_class()

Modifies post query so that it includes parent products whose variations have particular shipping class assigned.

public add_variation_parents_for_shipping_class(array $pieces, WP_Query $wp_query) : array
Parameters
$pieces : array

Array of SELECT statement pieces (from, where, etc).

$wp_query : WP_Query

WP_Query instance.

Return values
arrayArray of products, including parents of variations.

disable_view_mode()

Removes this type from list of post types that support "View Mode" switching.

public disable_view_mode(array $post_types) : array

View mode is seen on posts where you can switch between list or excerpt. Our post types don't support it, so we want to hide the useless UI from the screen options tab.

Parameters
$post_types : array

Array of post types supporting view mode.

Return values
arrayArray of post types supporting view mode, without this type.

handle_bulk_actions()

Handle bulk actions.

public handle_bulk_actions(string $redirect_to, string $action, array $ids) : string
Parameters
$redirect_to : string

URL to redirect to.

$action : string

Action name.

$ids : array

List of ids.

Return values
string