Skip to content
Docs
Get RestroPress

Filter

excerpt_length

Updated
On this page

Filters the word limit for menu item descriptions in menu templates.

This is the standard WordPress excerpt_length filter. The menu item templates call it with 40 to get the number of words to keep from the item excerpt or content before rpress_fooditems_excerpt or rpress_fooditems_content runs.

Parameters#

ParameterTypeDescription
$lengthintNumber of words. RestroPress passes 40.

Return value#

int. The number of words.

Example#

function my_menu_excerpt_length( $length ) {
	return 25;
}
add_filter( 'excerpt_length', 'my_menu_excerpt_length' );

Notes#

WordPress core hook, so changing it also affects post excerpts elsewhere on the site.

Source#

Applied in:

  • templates/fooditem/content-title.php (line 14)
  • templates/grid/content-title.php (line 14)
  • templates/list/content-title.php (line 14)
  • templates/packs/modern/list/single.php (line 75)

See also#

Was this page helpful?