*/ class ACT_Divi_Admin { /** * The ID of this plugin. * * @since 1.0.0 * @access private * @var string $ACT_Divi The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. * * @since 1.0.0 * @access private * @var string $version The current version of this plugin. */ private $version; /** * Initialize the class and set its properties. * * @since 1.0.0 * @param string $ACT_Divi The name of this plugin. * @param string $version The version of this plugin. */ public function __construct( $plugin_name, $version ) { $this->plugin_name = $plugin_name; $this->version = $version; add_action( 'admin_menu', array($this, 'admin_menu') ); } /** * Register the stylesheets for the admin area. * * @since 1.0.0 */ public function enqueue_styles() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in ACT_Divi_Loader as all of the hooks are defined * in that particular class. * * The ACT_Divi_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ // wp_die($this->plugin_name); wp_enqueue_style( $this->plugin_name.'-admin', plugin_dir_url( __FILE__ ) . "css/{$this->plugin_name}-admin.css", array(), $this->version, 'all' ); $current_screen = get_current_screen(); if($current_screen->id == 'toplevel_page_act_divi_settings'){ // wp_enqueue_style( 'epanel-style', get_template_directory_uri() . '/epanel/css/panel.css', array(), et_get_theme_version() ); $is_divi = ( 'toplevel_page_act_divi_settings' === $current_screen->id ); if ( ! wp_style_is( 'et-core-admin', 'enqueued' ) ) { wp_enqueue_style( 'et-core-admin-epanel', get_template_directory_uri() . '/core/admin/css/core.css', array(), et_get_theme_version() ); } wp_enqueue_style( 'epanel-style', get_template_directory_uri() . '/epanel/css/panel.css', array(), et_get_theme_version() ); if ( wp_style_is( 'activecampaign-subscription-forms', 'enqueued' ) ) { // activecampaign-subscription-forms style breaks the panel. wp_dequeue_style( 'activecampaign-subscription-forms' ); } // ePanel on theme others than Divi might want to add specific styling if ( ! apply_filters( 'et_epanel_is_divi', $is_divi ) ) { wp_enqueue_style( 'epanel-theme-style', apply_filters( 'et_epanel_style_url', get_template_directory_uri() . '/style-epanel.css'), array( 'epanel-style' ), et_get_theme_version() ); } global $themename; $epanel_jsfolder = get_template_directory_uri() . '/epanel/js'; et_core_load_main_fonts(); wp_register_script( 'epanel_colorpicker', $epanel_jsfolder . '/colorpicker.js', array(), et_get_theme_version() ); wp_register_script( 'epanel_eye', $epanel_jsfolder . '/eye.js', array(), et_get_theme_version() ); wp_register_script( 'epanel_checkbox', $epanel_jsfolder . '/checkbox.js', array(), et_get_theme_version() ); wp_enqueue_script( 'wp-color-picker' ); wp_enqueue_style( 'wp-color-picker' ); $wp_color_picker_alpha_uri = defined( 'ET_BUILDER_URI' ) ? ET_BUILDER_URI . '/scripts/ext/wp-color-picker-alpha.min.js' : $epanel_jsfolder . '/wp-color-picker-alpha.min.js'; wp_enqueue_script( 'wp-color-picker-alpha', $wp_color_picker_alpha_uri, array( 'jquery', 'wp-color-picker' ), et_get_theme_version(), true ); wp_enqueue_script( 'epanel_functions_init', $epanel_jsfolder . '/functions-init.js', array( 'jquery', 'jquery-ui-tabs', 'jquery-form', 'epanel_colorpicker', 'epanel_eye', 'epanel_checkbox', 'wp-color-picker-alpha' ), et_get_theme_version() ); wp_localize_script( 'epanel_functions_init', 'ePanelSettings', array( 'clearpath' => get_template_directory_uri() . '/epanel/images/empty.png', 'epanel_nonce' => wp_create_nonce( 'epanel_nonce' ), 'help_label' => esc_html__( 'Help', $themename ), 'et_core_nonces' => et_core_get_nonces(), ) ); // Use WP 4.9 CodeMirror Editor for some fields if ( function_exists( 'wp_enqueue_code_editor' ) ) { wp_enqueue_code_editor( array( 'type' => 'text/css', ) ); // Required for Javascript mode wp_enqueue_script( 'jshint' ); wp_enqueue_script( 'htmlhint' ); } } // echo "
";
//        print_r($screen);
//        echo "
"; // wp_die(); } /** * Register the JavaScript for the admin area. * * @since 1.0.0 */ public function enqueue_scripts() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in ACT_Divi_Loader as all of the hooks are defined * in that particular class. * * The ACT_Divi_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ // wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/plugin-name-admin.js', array( 'jquery' ), $this->version, false ); } function admin_menu() { add_menu_page( __( 'ACT', 'act-divi' ), __( 'ACT for Divi', 'act-divi' ), 'manage_options', 'act_divi_settings', array($this, 'plugin_page'), plugins_url( 'advanced-custom-types-divi/admin/img/icon-30x30.png' ), 99 ); } function plugin_page() { ?>

Advanced Custom Types for Divi

*/ ?>