Help & Info', 'absolute-weaver' /*adm*/), 'edit_theme_options', 'WeaverX', 'aweaver_admin_theme_page');
/* using registered $page handle to hook stylesheet loading for this admin page */
add_action('admin_print_styles-'.$page, 'aweaver_admin_scripts');
}
// callback for add_theme_page
function aweaver_admin_theme_page() {
$cur_vers = aweaver_wp_version();
if (version_compare($cur_vers, ABSOLUTE_WVR_MIN_WPVERSION, '<')) {
echo '
' . __('ERROR: You are using WordPress Version ', 'absolute-weaver' /*adm*/) . $GLOBALS['wp_version'] .
__(' Absolute Weaver requires WordPress Version ', 'absolute-weaver' /*adm*/) . ABSOLUTE_WVR_MIN_WPVERSION .
__(' or above. You should always upgrade to the latest version of WordPress for maximum site performance and security.', 'absolute-weaver' /*adm*/) .
'
'; // admin message
return;
}
require_once(get_template_directory() . ABSOLUTE_WVR_ADMIN_DIR . '/admin-top.php'); // NOW - load the admin stuff
do_action('aweaverplus_add_admin');
aweaver_do_admin();
}
function aweaver_wp_version() {
$wp_vers = $GLOBALS['wp_version'];
$cur_vers = $wp_vers;
$beta = strpos($cur_vers, '-');
if ( $beta > 0 ) {
$cur_vers = substr($cur_vers,0,$beta); // strip the beta part if there
}
return $cur_vers;
}
// callback for admin_print_styles in add_admin above
function aweaver_admin_scripts() {
/* called only on the admin page, enqueue our special style sheet here (for tabbed pages) */
wp_enqueue_style('wvrxaStylesheet', get_template_directory_uri().ABSOLUTE_WVR_ADMIN_DIR.'/assets/css/admin-style.css');
if ( is_rtl() )
wp_enqueue_style('wvrxartlStylesheet', get_template_directory_uri().ABSOLUTE_WVR_ADMIN_DIR.'/assets/css/admin-style-rtl.css');
wp_enqueue_style ("thickbox");
wp_enqueue_script ("thickbox");
//wp_enqueue_style('jquery-ui-dialog');
//wp_enqueue_style('jquery-ui-dialog');
// jsColor only needed from theme support plugin - Version 4.2
wp_enqueue_script('wvrxJscolor', get_template_directory_uri().'/assets/js/jscolor/jscolor.js',ABSOLUTE_WVR_VERSION); // .min fails
// wvrxCombined includes yetii, hide-css, and media-lib - changed for V 4.2
wp_enqueue_script('wvrxCombined', get_template_directory_uri().ABSOLUTE_WVR_ADMIN_DIR.'/assets/js/theme/weaver-combined'.ABSOLUTE_WVR_MINIFY.'.js',ABSOLUTE_WVR_VERSION);
}
//--
add_action('admin_head', 'aweaver_admin_head');
function aweaver_admin_head() { // action definition
}
} // END IF CAN EDIT POSTS ---------------------------------------------------------------------
function aweaver_load_admin_aux() {
// Add meta-blocks to page and post editor views
if (current_user_can('edit_posts')) { // allows only admin to see, also avoids loading at runtime
require_once(get_template_directory() . ABSOLUTE_WVR_ADMIN_DIR . '/admin-page-posts.php'); // per page-posts admin
}
}
if ( current_user_can('edit_posts') && !has_action('aweaver_load_customizer')) {
add_action('aweaver_load_customizer', 'aweaver_load_customizer_action');
function aweaver_load_customizer_action() {
require_once(get_template_directory() . '/admin/customizer/load-customizer.php'); // start by loading customizer features
}
}
?>