/**
  * When the status transient expires (or is deleted on activation), re-check the status
  *
  * @since 1.17
  *
  * @return void
  */
 public function refresh_license_status()
 {
     // Only perform on GravityView pages
     if (!gravityview_is_admin_page()) {
         return;
     }
     // The transient is fresh; don't fetch.
     if ($status = get_transient(self::status_transient_key)) {
         return;
     }
     $data = array('edd_action' => 'check_license', 'license' => trim($this->Addon->get_app_setting('license_key')), 'update' => true, 'format' => 'object', 'field_id' => 'refresh_license_status');
     $license_call = GravityView_Settings::get_instance()->get_license_handler()->license_call($data);
     do_action('gravityview_log_debug', __METHOD__ . ': Refreshed the license.', $license_call);
 }
Beispiel #2
0
         *      'title' => __( 'GravityView My Extension Settings', 'gravityview' ),
         *      'fields' => $settings,
         *   );
         *
         */
        $extension_sections = apply_filters('gravityview/settings/extension/sections', array());
        // If there are extensions, add a section for them
        if (!empty($extension_sections)) {
            $k = count($extension_sections) - 1;
            $extension_sections[$k]['fields'][] = $button;
            $sections = array_merge($sections, $extension_sections);
        } else {
            // add the 'update settings' button to the general section
            $sections[0]['fields'][] = $button;
        }
        return $sections;
    }
    /**
     * Get the setting for GravityView by name
     *
     * @param  string $key     Option key to fetch
     *
     * @return mixed
     */
    public static function getSetting($key)
    {
        return self::get_instance()->get_app_setting($key);
    }
}
GravityView_Settings::get_instance();
 /**
  * Set delete to true
  * @since 1.15
  */
 function _set_up_gravityview_settings($delete_on_uninstall)
 {
     $defaults = GravityView_Settings::get_instance()->get_app_settings();
     if (NULL === $delete_on_uninstall) {
         unset($defaults['delete-on-uninstall']);
     } else {
         $defaults['delete-on-uninstall'] = $delete_on_uninstall;
     }
     update_option('gravityformsaddon_gravityview_app_settings', $defaults);
     if (NULL !== $delete_on_uninstall) {
         $this->assertEquals($delete_on_uninstall, GravityView_Settings::get_instance()->get_app_setting('delete-on-uninstall'));
     }
 }