本文整理匯總了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);
}
}
示例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();
}