public static function getSettings() { global $current_user; if (self::$settings === null) { if (function_exists('get_currentuserinfo')) { get_currentuserinfo(); /** @var $settings - get use group access rules */ if (!empty($current_user->roles)) { self::$user_role = $current_user->roles[0]; } else { self::$user_role = 'author'; } } else { self::$user_role = 'author'; } self::$settings = WPBakeryVisualComposerSettings::get('groups_access_rules'); } return self::$settings; }
/** * Gets user role and access rules for current user. * * @static * @return mixed */ protected static function getSettings() { global $current_user; if (self::$settings === null) { if (function_exists('get_currentuserinfo')) { get_currentuserinfo(); /** @var Vc_Settings $settings - get use group access rules */ if (!empty($current_user->roles)) { self::$user_role = $current_user->roles[0]; } else { self::$user_role = 'author'; } } else { self::$user_role = 'author'; } self::$settings = vc_settings()->get('groups_access_rules'); } return self::$settings; }
/** * Gets user role and access rules for current user. * * @static * @return mixed */ protected static function getSettings() { global $current_user; // @todo fix_roles? what is this and why it is inside class-wpb-map? if (null !== self::$settings) { if (function_exists('get_currentuserinfo')) { get_currentuserinfo(); /** @var Vc_Settings $settings - get use group access rules */ if (!empty($current_user->roles)) { self::$user_role = $current_user->roles[0]; } else { self::$user_role = 'author'; } } else { self::$user_role = 'author'; } self::$settings = vc_settings()->get('groups_access_rules'); } return self::$settings; }