Filter
rpress_is_add_button_visible
On this page
Filters whether the add button is visible on the storefront.
Runs in rpress_is_add_button_visible(). The visibility is computed from the add_button_visibility setting; any value except 'hide' counts as visible.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$is_visible | bool | Whether the add button is visible. |
$visibility | string | Sanitized value of the add_button_visibility setting (default 'show'). |
Return value#
bool. True to show the add button.
Example#
function my_hide_add_button_when_closed( $is_visible, $visibility ) {
return $is_visible && rpress_is_store_open( 'delivery' );
}
add_filter( 'rpress_is_add_button_visible', 'my_hide_add_button_when_closed', 10, 2 );
Source#
Applied in:
includes/template-functions.php(line 539), inrpress_is_add_button_visible()
See also#
Was this page helpful?
