Yoast\WP\SEO\Introductions\Application

Ai_Fix_Assessments_Upsell::should_show()publicYoast 1.0

Returns whether this introduction should show.

Метод класса: Ai_Fix_Assessments_Upsell{}

Хуков нет.

Возвращает

true|false. Whether this introduction should show.

Использование

$Ai_Fix_Assessments_Upsell = new Ai_Fix_Assessments_Upsell();
$Ai_Fix_Assessments_Upsell->should_show();

Код Ai_Fix_Assessments_Upsell::should_show() Yoast 24.4

public function should_show() {

	if ( $this->product_helper->is_premium() ) {
		return false;
	}

	// Get the current user ID, if no user is logged in we bail as this is needed for the next checks.
	$current_user_id = $this->user_helper->get_current_user_id();
	if ( $current_user_id === 0 ) {
		return false;
	}

	if ( ! $this->is_user_allowed( [ 'edit_posts' ] ) ) {
		return false;
	}

	return true;
}