Filter
rpress_product_dropdown_args
On this page
Filters the query arguments used to build the menu item dropdown.
Runs in RPRESS_HTML_Elements::product_dropdown() after post_type, ordering, number and post status have been set. The array is passed to get_posts() to fetch the options. Selected menu items outside the query are added afterwards regardless.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$product_args | array | Arguments for get_posts(): post_type, orderby, order, posts_per_page and post_status. |
Return value#
array. The get_posts() arguments.
Example#
function my_product_dropdown_args( $args ) {
$args['orderby'] = 'menu_order';
return $args;
}
add_filter( 'rpress_product_dropdown_args', 'my_product_dropdown_args' );
Source#
Applied in:
includes/class-rpress-html-elements.php(line 64), inRPRESS_HTML_Elements::product_dropdown()
See also#
Was this page helpful?
