Skip to content
Docs
Get RestroPress

Filter

rpress_discount_labels

Updated
On this page

Filters the labels of the discount (rpress_discount) post type.

Runs when the post types are registered on init, before register_post_type() for 'rpress_discount'. The array holds the standard post type label keys such as 'name', 'singular_name', 'add_new_item' and 'menu_name'.

Parameters#

ParameterTypeDescription
$discount_labelsarrayLabel key => translated string.

Return value#

array. The labels array.

Example#

add_filter( 'rpress_discount_labels', 'my_discount_labels', 10, 1 );
function my_discount_labels( $discount_labels ) {
	$discount_labels['menu_name'] = __( 'Promo Codes', 'my-plugin' );
	return $discount_labels;
}

Source#

Applied in:

  • includes/post-types.php (line 108), in rpress_setup_rpress_post_types()

See also#

Was this page helpful?