WPSEO_Metabox_Formatter::multilingual_plugin_active()privateYoast 1.0

Checks whether a multilingual plugin is currently active. Currently, we only check the following plugins: WPML, Polylang, and TranslatePress.

{} Это метод класса: WPSEO_Metabox_Formatter{}

Хуков нет.

Возвращает

true|false. Whether a multilingual plugin is currently active.

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

// private - только в коде основоного (родительского) класса
$result = $this->multilingual_plugin_active();

Код WPSEO_Metabox_Formatter::multilingual_plugin_active() Yoast 19.7.1

private function multilingual_plugin_active() {
	$wpml_active           = YoastSEO()->classes->get( WPML_Conditional::class )->is_met();
	$polylang_active       = YoastSEO()->classes->get( Polylang_Conditional::class )->is_met();
	$translatepress_active = YoastSEO()->classes->get( TranslatePress_Conditional::class )->is_met();

	return ( $wpml_active || $polylang_active || $translatepress_active );
}