Skip to content
Docs
Get RestroPress

Filter

rpress_checkout_upsell_build_setting_options

Updated
On this page

Filters whether the upsell settings build their item and category lists.

The upsell item picker and category dropdown are only populated when the RestroPress settings page is being drawn, which avoids running term and post queries on other requests. The default is true on the rpress-settings admin page for non-AJAX requests.

Parameters#

ParameterTypeDescription
$buildboolTrue when the current request draws the settings page.

Return value#

bool. Whether to build the option lists.

Example#

add_filter( 'rpress_checkout_upsell_build_setting_options', 'my_upsell_build_options', 10, 1 );
function my_upsell_build_options( $build ) {
	return $build || ( defined( 'REST_REQUEST' ) && REST_REQUEST );
}

Source#

Applied in:

  • includes/features/checkout-upsell/loader.php (line 502), in rpress_checkout_upsell_is_settings_screen()
Was this page helpful?