WPSEO_Capability_Manager_Factory{}Yoast 1.0

Capability Manager Factory.

Хуков нет.

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

$WPSEO_Capability_Manager_Factory = new WPSEO_Capability_Manager_Factory();
// use class methods

Методы

  1. public static get( $plugin_type = 'free' )

Код WPSEO_Capability_Manager_Factory{} Yoast 19.11

class WPSEO_Capability_Manager_Factory {

	/**
	 * Returns the Manager to use.
	 *
	 * @param string $plugin_type Whether it's Free or Premium.
	 *
	 * @return WPSEO_Capability_Manager Manager to use.
	 */
	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 ];
	}
}