Skip to content
Docs
Get RestroPress

Filter

rpress_product_dropdown_args

Updated
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#

ParameterTypeDescription
$product_argsarrayArguments 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), in RPRESS_HTML_Elements::product_dropdown()

See also#

Was this page helpful?