本文整理匯總了PHP中Redux_Helpers::major_version方法的典型用法代碼示例。如果您正苦於以下問題:PHP Redux_Helpers::major_version方法的具體用法?PHP Redux_Helpers::major_version怎麽用?PHP Redux_Helpers::major_version使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Redux_Helpers
的用法示例。
在下文中一共展示了Redux_Helpers::major_version方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: check_version
public function check_version()
{
global $pagenow;
if ($pagenow == "admin-ajax.php" || $GLOBALS['pagenow'] == "customize" && isset($_GET['theme']) && !empty($_GET['theme'])) {
return;
}
$saveVer = Redux_Helpers::major_version(get_option('redux_version_upgraded_from'));
$curVer = Redux_Helpers::major_version(ReduxFramework::$_version);
$compare = false;
if (Redux_Helpers::isLocalHost()) {
$compare = true;
} else {
if (class_exists('ReduxFrameworkPlugin')) {
$compare = true;
} else {
$redux = ReduxFrameworkInstances::get_all_instances();
if (is_array($redux)) {
foreach ($redux as $panel) {
if ($panel->args['dev_mode'] == 1) {
$compare = true;
break;
}
}
}
}
}
if ($compare) {
$redirect = false;
if (empty($saveVer)) {
$redirect = true;
// First time
} else {
if (version_compare($curVer, $saveVer, '>')) {
$redirect = true;
// Previous version
}
}
if ($redirect && !defined('WP_TESTS_DOMAIN')) {
add_action('init', array($this, 'do_redirect'));
}
}
}
示例2: check_version
public function check_version()
{
global $pagenow;
if ($pagenow == "admin-ajax.php" || $GLOBALS['pagenow'] == "customize" && isset($_GET['theme']) && !empty($_GET['theme'])) {
return;
}
$saveVer = Redux_Helpers::major_version(get_option('redux_version_upgraded_from'));
$curVer = Redux_Helpers::major_version(ReduxFramework::$_version);
$compare = false;
if (Redux_Helpers::isLocalHost()) {
$compare = true;
} else {
if (class_exists('ReduxFrameworkPlugin')) {
$compare = true;
} else {
$redux = ReduxFrameworkInstances::get_all_instances();
foreach ($redux as $panel) {
if ($panel->args['dev_mode'] == 1) {
$compare = true;
break;
}
}
}
}
if ($compare) {
$redirect = false;
if (empty($saveVer)) {
$redirect = true;
// First time
} else {
if (version_compare($curVer, $saveVer, '>')) {
$redirect = true;
// Previous version
}
}
if ($redirect) {
//wp_safe_redirect( admin_url( 'tools.php?page=redux-about' ) );
//exit();
}
}
}