Файловый менеджер - Редактировать - /home/beautybuzzbeyond/public_html/wp-content/themes/music-night/framework/kf_function_regist.php
Назад
<?php /* * Kodeforest Framework Register * --------------------------------------------------------------------- * This file includes the function to upload values on activation * --------------------------------------------------------------------- */ if (!function_exists('musicnight_header_background')){ function musicnight_header_background(){ //Custom background Support $args = array( 'color-scheme' => '', 'default-image' => '', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ); //Custom Header Support $defaults = array( 'default-image' => '', 'random-default' => false, 'width' => 950, 'height' => 200, 'flex-height' => false, 'flex-width' => false, 'default-text-color' => '', 'header-text' => true, 'uploads' => true, 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', ); global $wp_version; if ( version_compare( $wp_version, '3.4', '>=' ) ){ add_theme_support( 'custom-background', $args ); add_theme_support( 'custom-header', $defaults ); } } } musicnight_header_background(); if (function_exists('register_sidebar')){ function musicnight_sidebar_creation(){ global $musicnight_theme_option; // default sidebar array $sidebar_attr = array( 'name' => '', 'description' => '', 'before_widget' => '<div class="widget sidebar-recent-post sidebar_section %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2>', 'after_title' => '</h2>' ); $item_class = 'col-md-4'; if(isset($musicnight_theme_option['footer-layout']) && $musicnight_theme_option['footer-layout'] == 1){ $item_class = 'col-md-6'; }else if(isset($musicnight_theme_option['footer-layout']) && $musicnight_theme_option['footer-layout'] == 2){ $item_class = 'col-md-4'; }else if(isset($musicnight_theme_option['footer-layout']) && $musicnight_theme_option['footer-layout'] == 3){ $item_class = 'col-md-3'; }else if(isset($musicnight_theme_option['footer-layout']) && $musicnight_theme_option['footer-layout'] == 4){ $item_class = 'col-md-3'; }else{ $item_class = 'col-md-4'; } $musicnight_sidebar = array("Footer"); foreach( $musicnight_sidebar as $sidebar_name ){ $sidebar_attr['name'] = $sidebar_name; $sidebar_slug = strtolower(str_replace(' ','-',$sidebar_name)); $sidebar_attr['id'] = 'sidebar-' . $sidebar_slug; $sidebar_attr['before_widget'] = '<div id="%1$s" class="'.esc_attr($item_class).' %2$s"><div class="widget kode-widget">' ; $sidebar_attr['after_widget'] = '</div></div>' ; $sidebar_attr['before_title'] = '<h4 class="widget_title footer_title ">'; $sidebar_attr['after_title'] = '</h4><div class="clear"></div>' ; $sidebar_attr['description'] = 'Please place '.esc_attr(strtolower($sidebar_name)).' widget here' ; register_sidebar($sidebar_attr); } if(isset($musicnight_theme_option['widget-heading-color']) && $musicnight_theme_option['widget-heading-color'] <> ''){ }else{ $musicnight_theme_option['widget-heading-color'] = '#333'; } if(!empty($musicnight_theme_option['sidebar-element'])){ $sidebar_id = 0; foreach( $musicnight_theme_option['sidebar-element'] as $sidebar_name ){ $sidebar_attr['name'] = $sidebar_name; $sidebar_slug = strtolower(str_replace(' ','-',$sidebar_name)); $sidebar_attr['id'] = 'sidebar-' . $sidebar_slug; $sidebar_attr['before_widget'] = '<div id="%1$s" class="widget kode-widget %2$s">' ; $sidebar_attr['after_widget'] = '</div>'; if(isset($musicnight_theme_option['widget-heading-style']) && $musicnight_theme_option['widget-heading-style'] == 'style-1'){ $sidebar_attr['before_title'] = '<div class="msl-black"><div class="msl-heading light-color"><h5><span style="color:'.esc_attr($musicnight_theme_option['widget-heading-color']).'">'; $sidebar_attr['after_title'] = '</span></h5></div></div>' ; }else if(isset($musicnight_theme_option['widget-heading-style']) && $musicnight_theme_option['widget-heading-style'] == 'style-2'){ $sidebar_attr['before_title'] = '<div class="kf_aside_twitter widget-02"><h6><i class="fa fa-twitter"></i>'; $sidebar_attr['after_title'] = '</h6></div>'; }else if(isset($musicnight_theme_option['widget-heading-style']) && $musicnight_theme_option['widget-heading-style'] == 'style-2'){ $sidebar_attr['before_title'] = '<div class="msl-black"><div class="msl-heading light-color"><h5><span style="color:'.esc_attr($musicnight_theme_option['widget-heading-color']).'">'; $sidebar_attr['after_title'] = '</span></h5></div></div>' ; }else if(isset($musicnight_theme_option['widget-heading-style']) && $musicnight_theme_option['widget-heading-style'] == 'style-3'){ $sidebar_attr['before_title'] = '<div class="music_heading hdg_2"><h3 style="color:'.esc_attr($musicnight_theme_option['widget-heading-color']).'">'; $sidebar_attr['after_title'] = '</h3><span><i class="fa icooooon-wave"></i></span></div>'; }else{ $sidebar_attr['before_title'] = '<div class="music_heading"><h3 style="color:'.esc_attr($musicnight_theme_option['widget-heading-color']).'">'; $sidebar_attr['after_title'] = '</h3><span><i class="fa icooooon-wave"></i></span></div>'; } $sidebar_attr['description'] = 'Please place '.esc_attr(strtolower($sidebar_name)).' page widget here' ; register_sidebar($sidebar_attr); } } } add_action('widgets_init','musicnight_sidebar_creation'); } // video size if( !function_exists('musicnight_get_video_size') ){ function musicnight_get_video_size( $size ){ global $_wp_additional_image_sizes, $musicnight_theme_option, $musicnight_crop_video; // get video ratio if( !empty($musicnight_theme_option['video-ratio']) && preg_match('#^(\d+)[\/:](\d+)$#', $musicnight_theme_option['video-ratio'], $number)){ $ratio = $number[1]/$number[2]; }else{ $ratio = 16/9; } // get video size $video_size = array('width'=>620, 'height'=>9999); if( !empty($size) && is_numeric($size) ){ $video_size['width'] = intval($size); }else if( !empty($size) && !empty($_wp_additional_image_sizes[$size]) ){ $video_size = $_wp_additional_image_sizes[$size]; }else if( !empty($size) && in_array($size, get_intermediate_image_sizes()) ){ $video_size = array('width'=>get_option($size . '_size_w'), 'height'=>get_option($size . '_size_h')); } // refine video size if( $musicnight_crop_video || $video_size['height'] == 9999 ){ return array('width'=>$video_size['width'], 'height'=>intval($video_size['width'] / $ratio)); }else if( $video_size['width'] == 9999 ){ return array('width'=>intval($video_size['height'] * $ratio), 'height'=>$video_size['height']); } return $video_size; } } // modify a wordpress gallery style add_filter('gallery_style', 'musicnight_gallery_style'); if( !function_exists('musicnight_gallery_style') ){ function musicnight_gallery_style( $style ){ return str_replace('border: 2px solid #cfcfcf;', 'border-width: 1px; border-style: solid;', $style); } } // turn the page comment off by default add_filter( 'wp_insert_post_data', 'musicnight_page_default_comments_off' ); if( !function_exists('musicnight_page_default_comments_off') ){ function musicnight_page_default_comments_off( $data ) { if( $data['post_type'] == 'page' && $data['post_status'] == 'auto-draft' ) { $data['comment_status'] = 0; } return $data; } } // add script and style to header area add_action( 'wp_head', 'musicnight_head_script' ); if( !function_exists('musicnight_head_script') ){ function musicnight_head_script() { global $musicnight_theme_option; if ( ! function_exists( 'has_site_icon' ) || ! has_site_icon() ) { // show the user your favicon theme option if( !empty($musicnight_theme_option['favicon-id']) ){ if( is_numeric($musicnight_theme_option['favicon-id']) ){ $favicon = wp_get_attachment_image_src($musicnight_theme_option['favicon-id'], 'full'); $musicnight_theme_option['favicon-id'] = esc_url($favicon[0]); } echo '<link rel="shortcut icon" href="' . esc_url($musicnight_theme_option['favicon-id']) . '" type="image/x-icon" />'; } } //<!-- load the script for older ie version --> } } // add support to post and comment RSS feed links to head add_theme_support( 'automatic-feed-links' ); // set up the content width based on the theme's design if ( !isset($content_width) ) $content_width = $musicnight_theme_option['content-width']; // add tinymce editor style add_action( 'init', 'musicnight_add_editor_styles' ); if( !function_exists('musicnight_add_editor_styles') ){ function musicnight_add_editor_styles() { add_editor_style('/stylesheet/editor-style.css'); } } // action to require the necessary wordpress function add_action( 'after_setup_theme', 'musicnight_theme_setup' ); if( !function_exists('musicnight_theme_setup') ){ function musicnight_theme_setup(){ global $musicnight_theme_option; // for translating the theme load_theme_textdomain( 'music-night', MUSICNIGHT_LOCAL_PATH . '/language/' ); // if(isset($musicnight_theme_option['kode-header-style']) && $musicnight_theme_option['kode-header-style'] == 'header-style-1'){ register_nav_menus( array( 'main_menu_left'=> esc_html__( 'Main Navigation Left', 'music-night' ), 'main_menu_right'=> esc_html__( 'Main Navigation Right', 'music-night' ), 'main_menu'=> esc_html__( 'Main Navigation', 'music-night' ), 'main_menu_responsive'=> esc_html__( 'Main Navigation Responsive', 'music-night' ), 'footer_menu'=> esc_html__( 'Footer Navigation', 'music-night' ), )); // } // adds RSS feed links to <head> for posts and comments. add_theme_support( 'automatic-feed-links' ); //WooCommerce Support add_theme_support( 'woocommerce' ); //title tags add_theme_support( 'title-tag' ); // This theme supports a variety of post formats. add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio' ) ); } } add_filter('get_the_excerpt', 'musicnight_strip_excerpt_link'); if( !function_exists('musicnight_strip_excerpt_link') ){ function musicnight_strip_excerpt_link( $excerpt ) { return preg_replace('#^https?://\S+#', '', $excerpt); } } if( !function_exists('musicnight_set_excerpt_length') ){ function musicnight_set_excerpt_length( $length ){ global $musicnight_excerpt_length; return $musicnight_excerpt_length ; } }
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка