Filter
rpress_addon_meta
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#
| Parameter | Type | Description |
|---|---|---|
$meta | mixed | Meta value from get_term_meta. |
$field | string | Term 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), inrpress_get_addon_data()
See also#
Was this page helpful?
