Help & Info', 'absolute-weaver' ) ), '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, '<' ) ) {
$wp_vers = $GLOBALS['wp_version'];
echo '
' . esc_html__( 'ERROR: You are using WordPress Version ', 'absolute-weaver' ) . esc_html( $cur_vers ) .
esc_html__( ' Absolute Weaver requires WordPress Version ', 'absolute-weaver' ) . esc_html( ABSOLUTE_WVR_MIN_WPVERSION ) .
esc_html__( 'or above. You should always upgrade to the latest version of WordPress for maximum site performance and security.', 'absolute-weaver' ) .
'
'; // admin message
return;
}
require_once( get_template_directory() . ABSOLUTE_WVR_ADMIN_DIR . '/admin-top.php' ); // NOW - load the admin stuff ( Not a template file )
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" );
// 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' );
// action definition
function aweaver_admin_head() {
}
} // End if().
// 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 ( Not a template file )
}
}
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 ( Not a template file )
}
}