WordPress at Your Fingertips
function is not described

WC_Marketplace_Suggestions::allow_suggestions() public WC 1.0

Should suggestions be displayed?

{} It's a method of the class: WC_Marketplace_Suggestions{}

Return

true|false.

Usage

$result = WC_Marketplace_Suggestions::allow_suggestions();

Code of WC_Marketplace_Suggestions::allow_suggestions() WC 5.9.0

public static function allow_suggestions() {
	// We currently only support English suggestions.
	$locale             = get_locale();
	$suggestion_locales = array(
		'en_AU',
		'en_CA',
		'en_GB',
		'en_NZ',
		'en_US',
		'en_ZA',
	);
	if ( ! in_array( $locale, $suggestion_locales, true ) ) {
		return false;
	}

	// Suggestions are only displayed if user can install plugins.
	if ( ! current_user_can( 'install_plugins' ) ) {
		return false;
	}

	// Suggestions may be disabled via a setting under Accounts & Privacy.
	if ( 'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) ) {
		return false;
	}

	// User can disabled all suggestions via filter.
	return apply_filters( 'woocommerce_allow_marketplace_suggestions', true );
}