Skip to content
Docs
Get RestroPress

Filter

rpress_is_add_button_visible

Updated
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#

ParameterTypeDescription
$is_visibleboolWhether the add button is visible.
$visibilitystringSanitized 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), in rpress_is_add_button_visible()

See also#

Was this page helpful?