Filter
rpress_purchase_link_defaults
On this page
Filters the default arguments for a menu item purchase link.
Runs in rpress_get_purchase_link() and rpress_get_purchase_link_grid() before the passed arguments are merged over the defaults with wp_parse_args(). Keys are fooditem_id, price, price_id, direct, text, checkout, style, color and class. Defaults come from the current post and the add-to-cart settings.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$defaults | array | Default purchase link arguments. |
Return value#
array. Default arguments.
Example#
function my_purchase_link_defaults( $defaults ) {
$defaults['class'] .= ' my-add-button';
return $defaults;
}
add_filter( 'rpress_purchase_link_defaults', 'my_purchase_link_defaults' );
Notes#
The list layout defaults style to the add_button_style setting with a fallback of 'rounded'; the grid layout falls back to 'button'.
Source#
Applied in:
includes/template-functions.php(line 105), inrpress_get_purchase_link()includes/template-functions.php(line 245), inrpress_get_purchase_link_grid()
See also#
Was this page helpful?
