Skip to content
Docs
Get RestroPress

Filter

rpress_addon_meta

Updated
On this page

Filters a term meta value of an add-on group or add-on item.

Runs in rpress_get_addon_data after get_term_meta reads the field for the given term. Typical fields are _type and _price. The term ID is not passed to the filter, so a callback sees only the value and the meta key.

Parameters#

ParameterTypeDescription
$metamixedMeta value from get_term_meta.
$fieldstringTerm meta key that was read, such as '_type' or '_price'.

Return value#

mixed. The meta value.

Example#

function my_addon_meta( $meta, $field ) {
	if ( '_price' === $field && '' === $meta ) {
		return 0;
	}
	return $meta;
}
add_filter( 'rpress_addon_meta', 'my_addon_meta', 10, 2 );

Source#

Applied in:

  • includes/fooditem-functions.php (line 775), in rpress_get_addon_data()

See also#

Was this page helpful?