hello
Server : Apache/2.4.52 (Ubuntu) System : Linux HAN2 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64 User : servadmin ( 1000) PHP Version : 8.1.2-1ubuntu2.25 Disable Function : NONE Directory : /www/docs/www.obusignal.com/www.obusignal.com/wp-content/themes/fox/ |
<?php
/* UPGRADE for current customers
================================================== */
include_once(dirname( __FILE__ ).'/inc/upgrade/updater-before56.php' );
include_once(dirname( __FILE__ ).'/inc/upgrade/upgrade.php' );
include_once(dirname( __FILE__ ).'/inc/upgrade/upgrade56.php' );
include_once(dirname( __FILE__ ).'/inc/upgrade/updater-interface.php' );
/* create admin bar
================================================== */
function fox56_adminbar_switch_version( $admin_bar ) {
if ( fox56_is_new_customer() ) {
return;
}
if ( ! current_user_can( 'manage_options' )) {
return;
}
if ( fox56_has_activated_6() ) {
return;
} else {
$admin_bar->add_menu([
'id' => 'fox56_upgrade',
'title' => 'Upgrade to FOX v6.0',
'href' => get_admin_url( '', 'admin.php?page=fox-updater' ),
]);
$admin_bar->add_menu([
'id' => 'fox56_support',
'title' => 'WiThemes Support',
'href' => 'https://withemes.ticksy.com/',
'meta' => [
'target' => '_blank',
'title' => 'Report issue about FOX v6.0',
]
]);
}
}
add_action('admin_bar_menu', 'fox56_adminbar_switch_version', 100);
add_action( 'admin_footer', 'fox56_switch_version_js' );
add_action( 'wp_footer', 'fox56_switch_version_js' );
add_action( 'wp_footer', 'fox56_version_switch_css' );
add_action( 'admin_footer', 'fox56_version_switch_css' );
function fox56_version_switch_css() { ?>
<style type="text/css">
#wpadminbar ul #wp-admin-bar-fox56_upgrade .ab-item, #wpadminbar ul #wp-admin-bar-fox56_upgrade:hover > .ab-item{background:#084d68;color:white;}
#wpadminbar ul #wp-admin-bar-fox56_revert .ab-item, #wpadminbar ul #wp-admin-bar-fox56_revert:hover > .ab-item{background:#304a5d;color:white;}
#wpadminbar ul #wp-admin-bar-fox56_support .ab-item, #wpadminbar ul #wp-admin-bar-fox56_support:hover > .ab-item{background:#1b6405;color:white;}
</style>
<?php
}
function fox56_switch_version_js() {
if ( ! current_user_can( 'manage_options') ) {
return;
}
?>
<script type="text/javascript" >
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
jQuery("li#wp-admin-bar-fox56_revert .ab-item, a.fox56-revert").on( "click", function( e ) {
e.preventDefault();
if ( ! confirm( "This is a backup button in case your theme version 6.0 doesn't work well for any reason and you wish to switch back to previous FOX version 5.5. Everything will be rolled back. You can contact WiThemes support to report any issue with FOX version 6.0 \n \
\n \
DO YOU WANT TO PROCESS ROLLING BACK?" ) ) {
return;
}
jQuery( 'html' ).css({ opacity: 0.3 })
var data = {
'action': 'fox56_revert',
};
jQuery.post(ajaxurl, data, function(response) {
if ( response.status == 'success' ) {
location.reload();
}
});
});
</script> <?php
}
add_action( 'wp_ajax_fox56_revert', 'fox56_revert_callback' );
function fox56_revert_callback() {
update_option( 'fox56_version', '5.5' );
wp_send_json([
'status' => 'success',
]);
wp_die();
}