Filter
rpress_product_dropdown_status_nopriv
On this page
Filters the post statuses of menu items listed for users without edit_products.
Used when building the menu item dropdown and when searching menu items over AJAX, for users who lack the edit_products capability. The default is publish only. The list is sanitized afterwards, and an empty or non-array value leaves the default query status in place.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$statuses | array | Post statuses to include. Default is array( 'publish' ). |
Return value#
array. Post statuses to include in the menu item list.
Example#
function my_dropdown_status_nopriv( $statuses ) {
$statuses[] = 'private';
return $statuses;
}
add_filter( 'rpress_product_dropdown_status_nopriv', 'my_dropdown_status_nopriv' );
Notes#
Fired from RP_AJAX::fooditem_search and RPRESS_HTML_Elements::product_dropdown with the same arguments.
Source#
Applied in:
includes/class-rpress-ajax.php(line 1564), inRP_AJAX::fooditem_search()includes/class-rpress-html-elements.php(line 52), inRPRESS_HTML_Elements::product_dropdown()
See also#
Was this page helpful?
