芝麻web文件管理V1.00
编辑当前文件:/home/seolotod/critterchoice.com/wp-content/themes/rehub-theme/admin/rehub.php
'_blank' ); // external links open in new tab/window $meta = array_merge( $meta, $custom_meta ); $wp_admin_bar->add_node( array( 'parent' => $parent, 'id' => $id, 'title' => $title, 'href' => $href, 'meta' => $meta, ) ); } } function rehub_framework_required() { if( !class_exists( 'REHub_Framework' ) ){ ?>
0){ $myaccounttemplate = get_post_meta($myaccountid, '_wp_page_template', true); $contenttype = get_post_meta($myaccountid, 'content_type', true); if ( ! $myaccounttemplate || 'default' == $myaccounttemplate ) { if(!$contenttype || $contenttype == 'def'){ update_post_meta($myaccountid, '_wp_page_template', 'template-systempages.php'); } } } $cartid = wc_get_page_id('cart'); if($cartid > 0){ $carttemplate = get_post_meta($cartid, '_wp_page_template', true); $contenttype = get_post_meta($cartid, 'content_type', true); if ( ! $carttemplate || 'default' == $carttemplate ) { if(!$contenttype || $contenttype == 'def'){ update_post_meta($cartid, '_wp_page_template', 'template-systempages.php'); } } } $checkoutid = wc_get_page_id('checkout'); if($checkoutid > 0){ $checkouttemplate = get_post_meta($checkoutid, '_wp_page_template', true); $contenttype = get_post_meta($checkoutid, 'content_type', true); if ( ! $checkouttemplate || 'default' == $checkouttemplate ) { if(!$contenttype || $contenttype == 'def'){ update_post_meta($checkoutid, '_wp_page_template', 'template-systempages.php'); } } } } if ( current_user_can( 'edit_theme_options' ) ) { header( 'Location:' . admin_url() . 'admin.php?page=rehub' ); } } /** * Actions to run on initial theme activation */ function rehub_admin_init() { if ( current_user_can( 'edit_theme_options' ) ) { if ( isset( $_GET['rehub-deactivate'] ) && $_GET['rehub-deactivate'] == 'deactivate-plugin' ) { check_admin_referer( 'rehub-deactivate', 'rehub-deactivate-nonce' ); $plugins = TGM_Plugin_Activation::$instance->plugins; foreach( $plugins as $plugin ) { if ( $plugin['slug'] == $_GET['plugin'] ) { deactivate_plugins( $plugin['file_path'] ); } } } if ( isset( $_GET['rehub-activate'] ) && $_GET['rehub-activate'] == 'activate-plugin' ) { check_admin_referer( 'rehub-activate', 'rehub-activate-nonce' ); $plugins = TGM_Plugin_Activation::$instance->plugins; foreach( $plugins as $plugin ) { if ( $plugin['slug'] == $_GET['plugin'] ) { activate_plugin( $plugin['file_path'] ); wp_redirect( admin_url( 'admin.php?page=rehub-plugins' ) ); exit; } } } //if(!defined('THEMESHILD_SLUG')){ //define('THEMESHILD_SLUG', 'rewise'); //} //require_once ( locate_template( 'admin/update-checker.php' ) ); } } function rehub_admin_menu(){ if ( current_user_can( 'edit_theme_options' ) ) { // Work around for theme check //$rehub_menu_page_creation_method = 'add_menu_page'; //$rehub_submenu_page_creation_method = 'add_submenu_page'; $welcome_screen = add_menu_page( 'ReHub', 'ReHub', 'administrator', 'rehub', array( $this, 'rehub_welcome_screen' ), 'dashicons-rehub-logo', 3 ); $support = add_submenu_page( 'rehub', esc_html__( 'ReHub Theme Support', 'rehub-theme' ), esc_html__( 'Support and tips', 'rehub-theme' ), 'administrator', 'rehub-support', array( $this, 'rehub_support_tab' ) ); $plugins = add_submenu_page( 'rehub', esc_html__( 'Plugins', 'rehub-theme' ), esc_html__( 'Plugins', 'rehub-theme' ), 'administrator', 'rehub-plugins', array( $this, 'rehub_plugins_tab' ) ); //$required_plugins = add_submenu_page( 'rehub', esc_html__( 'Required plugins', 'rehub-theme' ), esc_html__( 'Required plugins', 'rehub-theme' ), 'administrator', 'rehub-install-plugins', array( $this, 'rehub_plugins_sub' ) ); $demo_content = add_submenu_page( 'rehub', esc_html__( 'Demo content', 'rehub-theme' ), esc_html__( 'Demo Import', 'rehub-theme' ), 'administrator', 'import_demo', array( $this, 'demo_content_sub' )); $demos = add_submenu_page( 'rehub', esc_html__( 'Alternative Import', 'rehub-theme' ), esc_html__( 'Alternative Import', 'rehub-theme' ), 'administrator', 'rehub-demos', array( $this, 'rehub_demos_tab' ) ); if ( class_exists( 'REHub_Framework' ) ) { $theme_options = add_submenu_page( 'rehub', esc_html__( 'Theme Options', 'rehub-theme' ), esc_html__( 'Theme Options', 'rehub-theme' ), 'administrator', 'vpt_option'); } add_action( 'admin_print_scripts-'.$welcome_screen, array( $this, 'welcome_screen_scripts' ) ); add_action( 'admin_print_scripts-'.$support, array( $this, 'support_screen_scripts' ) ); add_action( 'admin_print_scripts-'.$demos, array( $this, 'demos_screen_scripts' ) ); add_action( 'admin_print_scripts-'.$plugins, array( $this, 'plugins_screen_scripts' ) ); } } function rehub_welcome_screen() { require_once( 'screens/welcome.php' ); } function rehub_support_tab() { require_once( 'screens/support.php' ); } function rehub_demos_tab() { require_once( 'screens/democlones.php' ); } function rehub_plugins_tab() { require_once( 'screens/plugins.php' ); } function demo_content_sub(){ if ( !rh_check_plugin_active( 'one-click-demo-import/one-click-demo-import.php' ) ) { ?>
does_plugin_have_update( $item['slug'] ); } /** We need to display the 'Install' hover link */ if ( ! isset( $installed_plugins[$item['file_path']] ) ) { $actions = array( 'install' => sprintf( '
Install
', esc_url( wp_nonce_url( add_query_arg( array( 'page' => urlencode( TGM_Plugin_Activation::$instance->menu ), 'plugin' => urlencode( $item['slug'] ), 'plugin_name' => urlencode( $item['sanitized_plugin'] ), 'plugin_source' => urlencode( $item['source'] ), 'tgmpa-install' => 'install-plugin', 'return_url' => 'rehub-plugins' ), TGM_Plugin_Activation::$instance->get_tgmpa_url() ), 'tgmpa-install', 'tgmpa-nonce' ) ), $item['sanitized_plugin'] ), ); } /** We need to display the 'Activate' hover link */ elseif ( is_plugin_inactive( $item['file_path'] ) ) { $actions = array( 'activate' => sprintf( '
Activate
', esc_url( add_query_arg( array( 'plugin' => urlencode( $item['slug'] ), 'plugin_name' => urlencode( $item['sanitized_plugin'] ), 'plugin_source' => urlencode( $item['source'] ), 'rehub-activate' => 'activate-plugin', 'rehub-activate-nonce' => wp_create_nonce( 'rehub-activate' ), ), admin_url( 'admin.php?page=rehub-plugins' ) ) ), $item['sanitized_plugin'] ), ); } /** We need to display the 'Update' hover link */ elseif ( version_compare( $installed_plugins[$item['file_path']]['Version'], $item['version'], '<' ) ) { $actions = array( 'update' => sprintf( '
Update
', wp_nonce_url( add_query_arg( array( 'page' => urlencode( TGM_Plugin_Activation::$instance->menu ), 'plugin' => urlencode( $item['slug'] ), 'tgmpa-update' => 'update-plugin', 'plugin_source' => urlencode( $item['source'] ), 'version' => urlencode( $item['version'] ), 'return_url' => 'rehub-plugins' ), TGM_Plugin_Activation::$instance->get_tgmpa_url() ), 'tgmpa-update', 'tgmpa-nonce' ), $item['sanitized_plugin'] ), ); } elseif ( rh_check_plugin_active( $item['file_path'] ) ) { $actions = array( 'deactivate' => sprintf( '
Deactivate
', esc_url( add_query_arg( array( 'plugin' => urlencode( $item['slug'] ), 'plugin_name' => urlencode( $item['sanitized_plugin'] ), 'plugin_source' => urlencode( $item['source'] ), 'rehub-deactivate' => 'deactivate-plugin', 'rehub-deactivate-nonce' => wp_create_nonce( 'rehub-deactivate' ), ), admin_url( 'admin.php?page=rehub-plugins' ) ) ), $item['sanitized_plugin'] ), ); } return $actions; } } new Rehub_Admin; } ////////////////////////////////////////////////////////////////// // UI for standard WP pages of login ////////////////////////////////////////////////////////////////// function rh_standard_wp_pages_styles() { ?> true, 'single' => true, 'type' => 'string', 'default' => '', 'auth_callback' => function() { return current_user_can('edit_posts'); } )); } add_action('enqueue_block_editor_assets', 'rh_block_sidebar_script'); function rh_block_sidebar_script() { // Only load on wp_block post type $screen = get_current_screen(); if ($screen->post_type !== 'wp_block') { return; } wp_enqueue_script( 'rh-block-sidebar', get_template_directory_uri() . '/admin/screens/js/block-sidebar.js', array('wp-element', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-plugins', 'wp-i18n'), '1.0.0', true ); wp_set_script_translations('rh-block-sidebar', 'rehub-framework'); } // Omit closing PHP tag to avoid "Headers already sent" issues.