Файловый менеджер - Редактировать - /home/beautybuzzbeyond/public_html/wp-content/themes/music-night/framework/include/kode_meta/kf_pagebuilder_scripts.php
Назад
<?php /* * Kodeforest Admin Panel * --------------------------------------------------------------------- * This file create the class that help you create the controls page builder * option for custom theme * --------------------------------------------------------------------- */ if( !class_exists('musicnight_page_options') ){ class musicnight_page_options{ public $settings; public $options; function __construct($options = array(),$settings = array() ){ $default_setting = array( 'post_type' => array('page'), 'meta_title' => esc_html__('Page Option', 'music-night'), 'meta_slug' => 'kodeforest-page-option', 'option_name' => 'post-option', 'position' => 'side', 'priority' => 'high', ); $this->settings = wp_parse_args($settings, $default_setting); $this->options = $options; // send the hook to create custom meta box add_action('add_meta_boxes', array(&$this, 'add_page_option_meta')); // add hook to save page options add_action('pre_post_update', array(&$this, 'musicnight_save_page_option')); } // load the necessary script for the page builder item function musicnight_load_admin_script(){ global $post,$musicnight_theme_option; if(isset($_GET['post-id'])){ $post_option = musicnight_decode_stopbackslashes(get_post_meta($_GET['post-id'], 'post-option', true)); }else{ $post_option = array(); } wp_deregister_style('accordion'); $post_option['property-lat'] = (empty($post_option['property-lat']))? '46.15242437752303': $post_option['property-lat']; $post_option['property-lon'] = (empty($post_option['property-lon']))? '2.7470703125': $post_option['property-lon']; wp_enqueue_script('gomap-api', '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places&key='.esc_attr($musicnight_theme_option['google-map-api']).''); wp_register_script('locationpicker', MUSICNIGHT_PATH . '/framework/include/backend_assets/js/locationpicker.js'); wp_localize_script( 'locationpicker', 'LOC', array('lat'=>$post_option['property-lat'],'lon'=>$post_option['property-lon']) ); wp_enqueue_script('locationpicker'); add_action('admin_enqueue_scripts', array(&$this, 'musicnight_enqueue_wp_media') ); wp_register_script('acordion', MUSICNIGHT_PATH.'/framework/include/frontend_assets/default/js/jquery_accordion.js', false, '1.0', true); wp_enqueue_script('acordion'); // include the sidebar generator style wp_enqueue_style('wp-color-picker'); wp_enqueue_script( 'wp-color-picker-alpha', MUSICNIGHT_PATH. '/framework/include/backend_assets/js/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), '1.0.0', true ); wp_enqueue_style('musicforest-alert-box', MUSICNIGHT_PATH . '/framework/include/backend_assets/css/kf_msg.css'); wp_enqueue_style('musicforest-page-option', MUSICNIGHT_PATH . '/framework/include/backend_assets/css/kf_pageoption.css'); wp_enqueue_style( 'font-awesome', MUSICNIGHT_PATH . '/framework/include/frontend_assets/font-awesome/css/font-awesome.min.css' ); //Font Awesome wp_enqueue_style('musicforest-admin-panel-html', MUSICNIGHT_PATH . '/framework/include/backend_assets/css/kf_element_meta.css'); wp_enqueue_style('musicforest-admin-chosen', MUSICNIGHT_PATH . '/framework/include/backend_assets/js/kode-chosen/chosen.min.css'); wp_enqueue_style('musicforest-edit-box', MUSICNIGHT_PATH . '/framework/include/backend_assets/css/kf_popup_window.css'); wp_enqueue_style('musicforest-page-builder', MUSICNIGHT_PATH . '/framework/include/backend_assets/css/kf_pagebuilder.css'); // wp_enqueue_script('musicforest-datetime', MUSICNIGHT_PATH . '/framework/include/backend_assets/css/musicforest-datetime.css'); wp_enqueue_style('musicforest-date-picker', MUSICNIGHT_PATH . '/framework/include/backend_assets/css/jquery-ui.css'); // include the sidebar generator script // wp_enqueue_script('wp-color-picker'); wp_enqueue_script('musicforest-utility', MUSICNIGHT_PATH . '/framework/include/backend_assets/js/kf_filter.js'); // wp_enqueue_script('musicforest-datetime', MUSICNIGHT_PATH . '/framework/include/backend_assets/js/musicforest-datetime.js'); wp_enqueue_script('musicforest-alert-box', MUSICNIGHT_PATH . '/framework/include/backend_assets/js/kf_msg.js'); wp_enqueue_script('musicforest-admin-panel-html', MUSICNIGHT_PATH . '/framework/include/backend_assets/js/kf_element_meta.js'); wp_enqueue_script('musicforest-edit-box', MUSICNIGHT_PATH . '/framework/include/backend_assets/js/kf_popup_window.js'); wp_enqueue_script('musicforest-save-settings', MUSICNIGHT_PATH . '/framework/include/backend_assets/js/kf_save_settings.js'); wp_enqueue_script('musicforest-slider-selection', MUSICNIGHT_PATH . '/framework/include/backend_assets/js/kf_media_center.js'); wp_enqueue_script('musicforest-gallery-selection', MUSICNIGHT_PATH . '/framework/include/backend_assets/js/kode-gallery-selection.js'); wp_enqueue_script('musicforest-admin-chosen', MUSICNIGHT_PATH . '/framework/include/backend_assets/js/kode-chosen/chosen.jquery.min.js'); wp_enqueue_script('musicforest-page-builder', MUSICNIGHT_PATH . '/framework/include/backend_assets/js/kf_pagebuilder.js'); wp_enqueue_script('jquery-ui-datepicker'); } //Media Manager function musicnight_enqueue_wp_media(){ if(function_exists( 'wp_enqueue_media' )){ wp_enqueue_media(); } } // create the page builder meta at the add_meta_boxes hook function add_page_option_meta(){ global $post; if(!empty($post)){ if( in_array($post->post_type, $this->settings['post_type']) ){ $this->musicnight_load_admin_script(); foreach( $this->settings['post_type'] as $post_type ){ add_meta_box( $this->settings['meta_slug'], $this->settings['meta_title'], array(&$this, 'create_page_option_elements'), $post_type, $this->settings['position'], $this->settings['priority'] ); } } } } // start creating the page builder element function create_page_option_elements(){ global $post; $option_value = musicnight_decode_stopbackslashes(get_post_meta( $post->ID, $this->settings['option_name'], true )); if( !empty($option_value) ){ $option_value = json_decode( $option_value, true ); } $option_generator = new musicnight_generate_admin_html(); echo '<div class="kode-page-option-wrapper position-' . esc_attr($this->settings['position']) . '" >'; foreach( $this->options as $option_section ){ echo '<div class="kode-page-option">'; echo '<div class="kode-page-option-title">' . esc_attr($option_section['title']) . '</div>'; echo '<div class="kode-page-option-input-wrapper row">'; foreach ( $option_section['options'] as $option_slug => $option ){ $option['slug'] = $option_slug; $option['name'] = $option_slug; if( !empty($option_value) && isset($option_value[$option_slug]) ){ $option['value'] = $option_value[$option_slug]; } $option_generator->musicnight_generate_html( $option ); } echo '</div>'; // page-option-input-wrapper echo '</div>'; // page-option-title } echo '<textarea class="kode-input-hidden" name="' . esc_attr($this->settings['option_name']) . '"></textarea>'; echo '</div>'; // kode-page-option-wrapper } // save page option setting function musicnight_save_page_option( $post_id ){ if( isset($_POST[$this->settings['option_name']]) ){ update_post_meta($post_id, $this->settings['option_name'], musicnight_stopbackslashes($_POST[$this->settings['option_name']])); } } } } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка