In the wp_user_meta
table there is a meta key edit_product_per_page
that sets this limit. By default 20.
However, to edit this setting for the admin product list you can use a filter hook from the get_items_per_page()
WordPress function
WP_List_Table::get_items_per_page() - Gets the number of items to display on a single page.
protected function get_items_per_page( $option, $default = 20 ) {
$per_page = (int) get_user_option( $option );
if ( empty( $per_page ) || $per_page < 1 ) {
$per_page = $default;
}
/**
* Filters the number of items to be displayed on each page of the list table.
*
* The dynamic hook name, `$option`, refers to the `per_page` option depending
* on the type of list table in use. Possible filter names include:
*
* - `edit_{$post_type}_per_page`
*
* @since 2.9.0
*
* @param int $per_page Number of items to be displayed. Default 20.
*/
return (int) apply_filters( "{$option}", $per_page );
}
So to answer your question, change {$post_type}
with product
and then you get:
function filter_edit_product_per_page ( $per_page ) {
// The number of items to be displayed on product page of the list table
$per_page = 50;
return $per_page;
}
add_filter( 'edit_product_per_page', 'filter_edit_product_per_page', 10, 1 );
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…