當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GFForms::get_wp_option方法代碼示例

本文整理匯總了PHP中GFForms::get_wp_option方法的典型用法代碼示例。如果您正苦於以下問題:PHP GFForms::get_wp_option方法的具體用法?PHP GFForms::get_wp_option怎麽用?PHP GFForms::get_wp_option使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GFForms的用法示例。


在下文中一共展示了GFForms::get_wp_option方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setup

 /**
  * Performs upgrade tasks when the version of the Add-On changes. To add additional upgrade tasks, override the upgrade() function, which will only get executed when the plugin version has changed.
  */
 protected function setup()
 {
     //Upgrading add-on
     $installed_version = get_option("gravityformsaddon_" . $this->_slug . "_version");
     //Making sure version has really changed. Gets around aggressive caching issue on some sites that cause setup to run multiple times.
     if ($installed_version != $this->_version) {
         $installed_version = GFForms::get_wp_option("gravityformsaddon_" . $this->_slug . "_version");
     }
     //Upgrade if version has changed
     if ($installed_version != $this->_version) {
         $this->upgrade($installed_version);
         update_option("gravityformsaddon_" . $this->_slug . "_version", $this->_version);
     }
 }
開發者ID:BisongT,項目名稱:Myevent_website,代碼行數:17,代碼來源:class-gf-addon.php

示例2: maybe_setup

 private static function maybe_setup()
 {
     // maybe set up Gravity Perks; only on admin requests for single site installs and always for multisite
     $is_non_ajax_admin = is_admin() && (defined('DOING_AJAX') && DOING_AJAX === true) === false;
     if (!$is_non_ajax_admin && !is_multisite()) {
         return;
     }
     $has_version_changed = get_option('gperks_version') != self::$version;
     // making sure version has really changed; gets around aggressive caching issue on some sites that cause setup to run multiple times
     if ($has_version_changed && is_callable(array('GFForms', 'get_wp_option'))) {
         $has_version_changed = GFForms::get_wp_option('gperks_version') != self::$version;
     }
     if (!$has_version_changed) {
         return;
     }
     self::setup();
 }
開發者ID:Ezyva2015,項目名稱:SMSF-Academy-Wordpress,代碼行數:17,代碼來源:gravityperks.php


注:本文中的GFForms::get_wp_option方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。