本文整理汇总了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();
}
}
}