Файловый менеджер - Редактировать - /home2/cocinasdalloway/public_html/tienda/wp-content/themes/negan/framework/classes/class-admin.php
Назад
<?php // Do not allow directly accessing this file. if ( ! defined( 'ABSPATH' ) ) { exit( 'Direct script access denied.' ); } class Negan_Admin { public function __construct(){ $this->init_page_options(); $this->init_meta_box(); $this->init_shortcode_manager(); Negan_MegaMenu_Init::get_instance(); add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts') ); add_action( 'customize_register', array( $this, 'override_customize_control') ); add_action( 'registered_post_type', array( $this, 'remove_revslider_metabox') ); add_action( 'admin_init', array( $this, 'admin_init' ) ); add_action( 'admin_menu', array( $this, 'admin_menu') ); } public function admin_scripts(){ wp_enqueue_style('negan-admin-css', Negan::$template_dir_url. '/assets/admin/css/admin.css'); wp_enqueue_script('negan-admin-theme', Negan::$template_dir_url . '/assets/admin/js/admin.js', array( 'jquery'), false, true ); } public function init_page_options(){ $options = !empty(Negan()->options()->sections) ? Negan()->options()->sections : array(); if(class_exists('LaStudio_Options')) { $settings = array( 'menu_title' => esc_html__('Theme Options', 'negan'), 'menu_type' => 'theme', 'menu_slug' => 'theme_options', 'ajax_save' => false, 'show_reset_all' => true, 'disable_header' => false, 'framework_title' => esc_html__('Negan', 'negan') ); if(!empty($options)){ LaStudio_Options::instance( $settings, $options, Negan::get_option_name()); } } if(class_exists('LaStudio_Customize') && function_exists('la_convert_option_to_customize')){ if(!empty($options)){ $customize_options = la_convert_option_to_customize($options); LaStudio_Customize::instance( $customize_options, Negan::get_option_name()); } } } public function init_meta_box(){ $default_metabox_opts = !empty(Negan()->options()->metabox_sections) ? Negan()->options()->metabox_sections : array(); if(!class_exists('LaStudio_Metabox')){ return; } if(empty($default_metabox_opts)){ return; } $metaboxes = array(); $taxonomy_metaboxes = array(); /** * Pages */ $metaboxes[] = array( 'id' => Negan::get_original_option_name(), 'title' => esc_html__('Page Options', 'negan'), 'post_type' => 'page', 'context' => 'normal', 'priority' => 'high', 'sections' => Negan()->options()->get_metabox_by_sections(array( 'layout', 'header', 'page_title_bar', 'footer', 'additional', 'fullpage' )) ); /** * Post */ $metaboxes[] = array( 'id' => Negan::get_original_option_name(), 'title' => esc_html__('Post Options', 'negan'), 'post_type' => 'post', 'context' => 'normal', 'priority' => 'high', 'sections' => Negan()->options()->get_metabox_by_sections(array( 'post', 'layout', 'header', 'page_title_bar', 'footer', 'additional' )) ); /** * Product */ $metaboxes[] = array( 'id' => Negan::get_original_option_name(), 'title' => esc_html__('Product View Options', 'negan'), 'post_type' => 'product', 'context' => 'normal', 'priority' => 'default', 'sections' => Negan()->options()->get_metabox_by_sections(array( 'layout', 'header', 'page_title_bar', 'footer', 'additional' )) ); /** * Portfolio */ $metaboxes[] = array( 'id' => Negan::get_original_option_name(), 'title' => esc_html__('Portfolio Options', 'negan'), 'post_type' => 'la_portfolio', 'context' => 'normal', 'priority' => 'high', 'sections' => Negan()->options()->get_metabox_by_sections(array( 'portfolio', 'layout', 'header', 'page_title_bar', 'footer', 'additional' )) ); /** * Testimonial */ $metaboxes[] = array( 'id' => Negan::get_original_option_name(), 'title' => esc_html__('Testimonial Information', 'negan'), 'post_type' => 'la_testimonial', 'context' => 'normal', 'priority' => 'high', 'sections' => Negan()->options()->get_metabox_by_sections(array( 'testimonial' )) ); /** * Member */ $metaboxes[] = array( 'id' => Negan::get_original_option_name(), 'title' => esc_html__('Page Options', 'negan'), 'post_type' => 'la_team_member', 'context' => 'normal', 'priority' => 'high', 'sections' => Negan()->options()->get_metabox_by_sections(array( 'member', 'layout', 'header', 'page_title_bar', 'footer', 'additional' )) ); /** * Product Category */ $taxonomy_metaboxes[] = array( 'id' => Negan::get_original_option_name(), 'title' => esc_html__('Product Category Options', 'negan'), 'taxonomy' => 'product_cat', 'sections' => Negan()->options()->get_metabox_by_sections(array( 'layout', 'header', 'page_title_bar', 'footer', 'additional' )) ); /** * Category */ $taxonomy_metaboxes[] = array( 'id' => Negan::get_original_option_name(), 'title' => esc_html__('Category Options', 'negan'), 'taxonomy' => 'category', 'sections' => Negan()->options()->get_metabox_by_sections(array( 'layout', 'header', 'page_title_bar', 'footer', 'additional' )) ); LaStudio_Metabox::instance($metaboxes); LaStudio_Taxonomy::instance($taxonomy_metaboxes); } public function init_shortcode_manager(){ if(class_exists('LaStudio_Shortcode_Manager')){ $options = array(); $options[] = array( 'title' => esc_html__('La Shortcodes', 'negan'), 'shortcodes' => array( array( 'name' => 'la_text', 'title' => esc_html__('Custom Text', 'negan'), 'fields' => array( array( 'id' => 'color', 'type' => 'color_picker', 'title' => esc_html__('Color', 'negan') ), array( 'id' => 'font_size', 'type' => 'responsive', 'title' => esc_html__('Font Size', 'negan'), 'desc' => esc_html__('Enter the font size (ie 20px )', 'negan') ), array( 'id' => 'line_height', 'type' => 'responsive', 'title' => esc_html__('Line Height', 'negan'), 'desc' => esc_html__('Enter the line height (ie 20px )', 'negan') ), array( 'id' => 'el_class', 'type' => 'text', 'title' => esc_html__('Extra Class Name', 'negan') ), array( 'id' => 'content', 'type' => 'textarea', 'title' => esc_html__('Content', 'negan') ) ) ), array( 'name' => 'la_btn', 'title' => esc_html__('Button', 'negan'), 'fields' => array( array( 'id' => 'title', 'type' => 'text', 'title' => esc_html__('Text', 'negan'), 'default' => esc_html__('Text on the button', 'negan') ), array( 'id' => 'link', 'type' => 'fieldset', 'title' => esc_html__('URL (Link)', 'negan'), 'desc' => esc_html__('Add link to button.', 'negan'), 'before' => '<div data-parent-atts="1" data-atts="link" data-atts-separator="|">', 'after' => '</div>', 'fields' => array( array( 'id' => 'url', 'type' => 'text', 'title' => esc_html__('URL', 'negan'), 'default' => '#', 'attributes' => array( 'data-child-atts' => 'url' ) ), array( 'id' => 'title', 'type' => 'text', 'title' => esc_html__('Link Text', 'negan'), 'attributes' => array( 'data-child-atts' => 'title' ) ), array( 'id' => 'target', 'type' => 'radio', 'default' => '_self', 'class' => 'la-radio-style', 'title' => esc_html__('Open link in a new tab', 'negan'), 'options' => array( '_self' => esc_html__('No', 'negan'), '_blank' => esc_html__('Yes', 'negan') ), 'attributes' => array( 'data-child-atts' => 'target', 'data-check' => 'yes' ) ), ), ), array( 'id' => 'style', 'type' => 'select', 'title' => esc_html__('Style', 'negan'), 'desc' => esc_html__('Select button display style.', 'negan'), 'options' => array( 'flat' => esc_html__('Flat', 'negan'), 'outline' => esc_html__('Outline', 'negan'), ), 'default' => 'flat' ), array( 'id' => 'color', 'type' => 'select', 'title' => esc_html__('Color', 'negan'), 'desc' => esc_html__('Select button color.', 'negan'), 'options' => array( 'black' => esc_html__('Black', 'negan'), 'primary' => esc_html__('Primary', 'negan'), 'white' => esc_html__('White', 'negan'), 'white2' => esc_html__('White2', 'negan'), 'gray' => esc_html__('Gray', 'negan'), ), 'default' => 'black' ), array( 'id' => 'size', 'type' => 'select', 'title' => esc_html__('Size', 'negan'), 'desc' => esc_html__('Select button display size.', 'negan'), 'options' => array( 'md' => esc_html__('Normal', 'negan'), 'lg' => esc_html__('Large', 'negan'), 'sm' => esc_html__('Small', 'negan'), 'xs' => esc_html__('Mini', 'negan') ), 'default' => 'md' ), array( 'id' => 'align', 'type' => 'select', 'title' => esc_html__('Alignment', 'negan'), 'desc' => esc_html__('Select button alignment.', 'negan'), 'options' => array( 'inline' => esc_html__('Inline', 'negan'), 'left' => esc_html__('Left', 'negan'), 'right' => esc_html__('Right', 'negan'), 'center' => esc_html__('Center', 'negan') ), 'default' => 'left' ), array( 'id' => 'el_class', 'type' => 'text', 'title' => esc_html__('Extra Class Name', 'negan'), 'desc' => esc_html__('Style particular content element differently - add a class name and refer to it in custom CSS.', 'negan') ) ) ), array( 'name' => 'la_dropcap', 'title' => esc_html__('DropCap', 'negan'), 'fields' => array( array( 'id' => 'style', 'type' => 'select', 'title' => esc_html__('Design', 'negan'), 'options' => array( '1' => esc_html__('Style 1', 'negan') ) ), array( 'id' => 'color', 'type' => 'color_picker', 'title' => esc_html__('Text Color', 'negan') ), array( 'id' => 'content', 'type' => 'text', 'title' => esc_html__('Content', 'negan') ) ) ), array( 'name' => 'la_quote', 'title' => esc_html__('Custom Quote', 'negan'), 'fields' => array( array( 'id' => 'style', 'type' => 'select', 'title' => esc_html__('Design', 'negan'), 'options' => array( '1' => esc_html__('Style 1', 'negan'), '2' => esc_html__('Style 2', 'negan') ) ), array( 'id' => 'author', 'type' => 'text', 'title' => esc_html__('Source Name', 'negan') ), array( 'id' => 'link', 'type' => 'text', 'title' => esc_html__('Source Link', 'negan') ), array( 'id' => 'content', 'type' => 'textarea', 'title' => esc_html__('Content', 'negan') ) ) ), array( 'name' => 'la_icon_list', 'title' => esc_html__('Icon List', 'negan'), 'view' => 'clone', 'clone_id' => 'la_icon_list_item', 'clone_title' => esc_html__('Add New', 'negan'), 'fields' => array( array( 'id' => 'el_class', 'type' => 'text', 'title' => esc_html__('Extra Class', 'negan'), 'desc' => esc_html__('Style particular content element differently - add a class name and refer to it in custom CSS.', 'negan'), ) ), 'clone_fields' => array( array( 'id' => 'icon', 'type' => 'icon', 'default' => 'fa fa-check', 'title' => esc_html__('Icon', 'negan') ), array( 'id' => 'icon_color', 'type' => 'color_picker', 'title' => esc_html__('Icon Color', 'negan') ), array( 'id' => 'content', 'type' => 'textarea', 'title' => esc_html__('Content', 'negan') ), array( 'id' => 'el_class', 'type' => 'text', 'title' => esc_html__('Extra Class', 'negan'), 'desc' => esc_html__('Style particular content element differently - add a class name and refer to it in custom CSS.', 'negan'), ) ) ), ) ); LaStudio_Shortcode_Manager::instance( $options ); } } public function remove_revslider_metabox($post_type){ add_action('do_meta_boxes', function () use ($post_type) { remove_meta_box('mymetabox_revslider_0', $post_type, 'normal'); }); } public function admin_menu(){ /* * @Todo remove the submenu items * @Example: Custom Header,Custom Background * We need use global variable `$submenu` */ } public function override_customize_control( $wp_customize ) { $wp_customize->remove_section('colors'); $wp_customize->remove_section('header_image'); $wp_customize->remove_section('background_image'); $wp_customize->remove_control('display_header_text'); $wp_customize->remove_control('site_icon'); $wp_customize->remove_control('custom_css'); } public function admin_init(){ add_filter('tiny_mce_before_init', array( $this, 'add_control_to_tinymce')); add_filter('mce_buttons_2', array( $this, 'add_button_to_tinymce')); } public function add_button_to_tinymce($buttons){ array_unshift($buttons, 'styleselect'); return $buttons; } public function add_control_to_tinymce($settings){ $style_formats = array( array( 'title' => esc_html__('Styled Subtitle', 'negan'), 'inline' => 'small', 'classes' => 'small' ), array( 'title' => esc_html__('Title H1', 'negan'), 'block' => 'div', 'classes' => 'h1' ), array( 'title' => esc_html__('Title H2', 'negan'), 'block' => 'div', 'classes' => 'h2' ), array( 'title' => esc_html__('Title H3', 'negan'), 'block' => 'div', 'classes' => 'h3' ), array( 'title' => esc_html__('Title H4', 'negan'), 'block' => 'div', 'classes' => 'h4' ), array( 'title' => esc_html__('Title H5', 'negan'), 'block' => 'div', 'classes' => 'h5' ), array( 'title' => esc_html__('Title H6', 'negan'), 'block' => 'div', 'classes' => 'h6' ), array( 'title' => esc_html__('Light Title', 'negan'), 'inline' => 'span', 'classes' => 'light' ), array( 'title' => esc_html__('Highlight Font', 'negan'), 'inline' => 'span', 'classes' => 'highlight-font-family' ) ); $settings['wordpress_adv_hidden'] = false; $settings['style_formats'] = json_encode($style_formats); return $settings; } }
| ver. 1.4 |
Github
|
.
| PHP 8.2.22 | Генерация страницы: 0.01 |
proxy
|
phpinfo
|
Настройка