/** * Gets the settings data for an ideal settings page with everything unlocked. Caches these settings to an internal * property so we don't make duplicate calls during the lifetime of a request. Note: we can cache this way simply * because the domain name will not change and we won't need to bust the cache during a page load. * * @return array|bool|mixed|null */ public static function get_settings_data($username = '', $api_key = '') { // Return if already requested if (self::$_settings_data) { return self::$_settings_data; } // Use username if none passed if (empty($username)) { $username = PushUp_Notifications_Core::get_username(); } // Use api key is none passed if (empty($api_key)) { $api_key = PushUp_Notifications_Core::get_api_key(); } $site_url = PushUp_Notifications_Core::get_site_url(); $actions = array('push.authenticate' => array('username' => $username, 'api_key' => $api_key), 'push.domain' => array('domain' => $site_url), 'push.analytics' => array('domain' => $site_url), 'push.domain.config' => array('domain' => $site_url), 'push.user.id' => array('username' => $username, 'api_key' => $api_key)); self::$_settings_data = self::perform_authenticated_query($actions, $username, $api_key); return self::$_settings_data; }