class-role-manager-factory.php 546 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\Roles
  6. */
  7. /**
  8. * Role Manager Factory.
  9. */
  10. class WPSEO_Role_Manager_Factory {
  11. /**
  12. * Retrieves the Role manager to use.
  13. *
  14. * @return WPSEO_Role_Manager
  15. */
  16. public static function get() {
  17. static $manager = null;
  18. if ( $manager === null ) {
  19. if ( function_exists( 'wpcom_vip_add_role' ) ) {
  20. $manager = new WPSEO_Role_Manager_VIP();
  21. }
  22. if ( ! function_exists( 'wpcom_vip_add_role' ) ) {
  23. $manager = new WPSEO_Role_Manager_WP();
  24. }
  25. }
  26. return $manager;
  27. }
  28. }