Filter
rpress_modify_service_label
On this page
Filters the display label of a service type (Delivery or Pickup) in the front-end service selectors.
Applied wherever a service tab or heading is rendered: the delivery and pickup tabs in the grid and list menu layouts, the date and time popup, and the checkout service selector. The value starts as the output of rpress_service_label(), which maps delivery and pickup to their translated names. The result is passed through wp_kses() in the tab templates and stripped of tags in the popup and checkout heading, so only simple inline markup survives in the tabs.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$label | string | Service label returned by rpress_service_label(), for example the translated text for Delivery or Pickup. |
Return value#
string. The label to display.
Example#
add_filter( 'rpress_modify_service_label', 'my_rename_pickup_label' );
function my_rename_pickup_label( $label ) {
if ( rpress_service_label( 'pickup' ) === $label ) {
return __( 'Collection', 'my-textdomain' );
}
return $label;
}
Notes#
The filter receives only the label, not the service slug. Compare against rpress_service_label() output to target a specific service.
Source#
Applied in:
templates/grid/delivery-option.php(line 92)templates/list/delivery-option.php(line 105)templates/rpress-datetime-popup.php(line 85)templates/rpress-delivery-steps.php(line 30)templates/rpress-delivery-steps.php(line 149)
