Skip to content
Docs
Get RestroPress

Action

rp_get_categories

Updated
On this page

Fires to print the category menu in the menu list templates.

Runs in the fooditem and list menu templates. Core hooks get_fooditems_categories() here, which loads the category navigation template with the parameters. Remove that callback and hook your own to replace the category menu.

Parameters#

ParameterTypeDescription
$category_paramsarrayCategory query settings with keys orderby, order, ids, category_menu and excluded_category.

Example#

function my_category_menu( $category_params ) {
	echo '<p class="my-category-count">' . count( (array) $category_params['ids'] ) . '</p>';
}
add_action( 'rp_get_categories', 'my_category_menu', 20, 1 );

Source#

Fired from:

  • templates/fooditem/fooditems.php (line 46)
  • templates/list/fooditems.php (line 81)

See also#

Was this page helpful?