Skip to content
Docs
Get RestroPress

Filter

rpress_product_details_widget_fooditem_title

Updated
On this page

Filters the menu item title markup in the menu item details widget.

Runs when the menu item details widget builds its output and the "show title" option is enabled. The default is the item title wrapped in an h3 element. When that option is off the filter does not run.

Parameters#

ParameterTypeDescription
$title_htmlstringThe title markup, by default an h3 element with the item title.
$fooditem_idintID of the menu item shown in the widget.

Return value#

string. The title markup.

Example#

function my_details_widget_title( $title_html, $fooditem_id ) {
	return '<h3>' . esc_html( get_the_title( $fooditem_id ) ) . '</h3>';
}
add_filter( 'rpress_product_details_widget_fooditem_title', 'my_details_widget_title', 10, 2 );

Notes#

The final value is printed through esc_html(), so any HTML you return is shown as escaped text.

Source#

Applied in:

  • includes/widgets.php (line 236), in RPRESS_Product_Details_Widget::widget()

See also#

Was this page helpful?