Filter
rpress_product_dropdown_status
On this page
Filters the post statuses of menu items listed for users with edit_products.
Used when building the menu item dropdown and when searching menu items over AJAX, for users who have the edit_products capability. The default includes publish, draft, private and future. 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', 'draft', 'private', 'future' ). |
Return value#
array. Post statuses to include in the menu item list.
Example#
function my_dropdown_status( $statuses ) {
return array_diff( $statuses, array( 'draft' ) );
}
add_filter( 'rpress_product_dropdown_status', 'my_dropdown_status' );
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 1566), inRP_AJAX::fooditem_search()includes/class-rpress-html-elements.php(line 54), inRPRESS_HTML_Elements::product_dropdown()
See also#
Was this page helpful?
