WPSEO_Capability_Manager_Factory::get()public staticYoast 1.0

Returns the Manager to use.

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

Хуков нет.

Возвращает

WPSEO_Capability_Manager. Manager to use.

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

$result = WPSEO_Capability_Manager_Factory::get( $plugin_type );
$plugin_type(строка)
Whether it's Free or Premium.
По умолчанию: 'free'

Код WPSEO_Capability_Manager_Factory::get() Yoast 24.0

public static function get( $plugin_type = 'free' ) {
	static $manager = [];

	if ( ! array_key_exists( $plugin_type, $manager ) ) {
		if ( function_exists( 'wpcom_vip_add_role_caps' ) ) {
			$manager[ $plugin_type ] = new WPSEO_Capability_Manager_VIP();
		}

		if ( ! function_exists( 'wpcom_vip_add_role_caps' ) ) {
			$manager[ $plugin_type ] = new WPSEO_Capability_Manager_WP();
		}
	}

	return $manager[ $plugin_type ];
}