File manager - Edit - /home/verseaumee/TF89388/wp-content/plugins/noisa-toolkit/includes/metabox-options/common.php
Back
<?php /** * Rascals MetaBox * * Register Post Metabox * * @author Rascals Themes * @category Core * @package Noisa Toolkit * @version 1.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed diCustomizer } /** * Return Intro options depend on displayed page or post * @return array */ function noisa_toolkit_mb_intro_opts(){ global $post, $title, $action, $current_screen; /* Get post/page data */ $template_name = ''; $post_type = ''; if ( isset( $_GET['post'] ) ) { $template_name = get_post_meta( $_GET['post'], '_wp_page_template', true ); $post_type = get_post_type( $_GET['post'] ); } elseif ( isset( $_GET['post_type'] ) ) { $post_type = $_GET['post_type']; } // Intro type $intro_type = array( array( 'name' => esc_html__( 'Disabled', 'noisa-toolkit' ), 'value' => 'disabled' ), array( 'name' => esc_html__( 'Page Title', 'noisa-toolkit' ), 'value' => 'intro_page_title' ), array( 'name' => esc_html__( 'Content', 'noisa-toolkit' ), 'value' => 'intro_content' ), array( 'name' => esc_html__( 'Full Screen Image', 'noisa-toolkit' ), 'value' => 'intro_full_image' ), array( 'name' => esc_html__( 'Full Screen Image with Content', 'noisa-toolkit' ), 'value' => 'intro_full_image_content' ), array( 'name' => esc_html__( 'Image', 'noisa-toolkit' ), 'value' => 'intro_image' ), array( 'name' => esc_html__( 'Image Zoom Out', 'noisa-toolkit' ), 'value' => 'intro_image_zoom_out' ), array( 'name' => esc_html__( 'Full Screen Slider', 'noisa-toolkit' ), 'value' => 'intro_full_slider' ), array( 'name' => esc_html__( 'Slider', 'noisa-toolkit' ), 'value' => 'intro_slider' ), array( 'name' => esc_html__( 'YouTube Background', 'noisa-toolkit' ), 'value' => 'intro_youtube' ), array( 'name' => esc_html__( 'Full Screen YouTube Background', 'noisa-toolkit' ), 'value' => 'intro_youtube_fullscreen' ), array( 'name' => esc_html__( 'Google Map', 'noisa-toolkit' ), 'value' => 'gmap' ), ); /* Special options for posts and pages templates */ if ( $template_name === 'page-templates/fullscreen.php' ) { $intro_type[] = array( array( 'name' => esc_html__( 'Full Screen Image', 'noisa-toolkit' ), 'value' => 'intro_full_image' ), array( 'name' => esc_html__( 'Full Screen Image with Content', 'noisa-toolkit' ), 'value' => 'intro_full_image_content' ), array( 'name' => esc_html__( 'Full Screen Slider', 'noisa-toolkit' ), 'value' => 'intro_full_slider' ), array( 'name' => esc_html__( 'Full Screen YouTube Background', 'noisa-toolkit' ), 'value' => 'intro_youtube_fullscreen' ) ); }; if ( $template_name === 'page-templates/blog-grid.php' || $template_name === 'page-templates/blog.php') { $intro_type[] = array( 'name' => esc_html__( 'Featured Post', 'noisa-toolkit' ), 'value' => 'featured_post' ); }; if ( $post_type === 'noisa_artists' ) { $intro_type[] = array( 'name' => esc_html__( 'Artist Profile', 'noisa-toolkit' ), 'value' => 'artist_profile' ); }; if ( in_array( 'revslider/revslider.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { $intro_type[] = array( 'name' => esc_html__( 'Revolution Slider', 'noisa-toolkit' ), 'value' => 'revslider' ); }; return $intro_type; } /** * Display common metaboxes * @param string $tab_name * @return array */ function noisa_toolkit_mb_common( $tab_name = null ) { /** * $rascals_mb->getTracks( 'post_name' ) * $rascals_mb->getRevoSliders() * $rascals_mb->getSlider( 'post_name' ) * $rascals_mb->getTracks( 'post_name' ) * $rascals_mb->getSidebars( 'panel_opt_name', 'option_name' ) */ $rascals_mb = NoisaToolkit::getInstance()->metaboxes; $common_metaboxes = array( /* ================================================== Tab Facebook Sharing ================================================== */ 'facebook_sharing_tab' => array( array( 'name' => esc_html__( 'Facebook Sharing', 'noisa-toolkit' ), 'id' => 'tab-share', 'type' => 'tab_open', ), /* Is Facebook sharing */ array( 'name' => esc_html__( 'Facebook Sharing', 'noisa-toolkit' ), 'id' => '_fb_sharing', 'type' => 'switch_button', 'std' => true, 'options' => array( array( 'name' => 'On', 'value' => true ), // ON array( 'name' => 'Off', 'value' => '0' ) // OFF ), 'separator' => true, 'desc' => esc_html__( 'Show or hide Facebook share options (head tags). Tip: This option can be set as the default in Theme Customizer > Single Post', 'noisa-toolkit' ), ), /* Image */ array( 'name' => esc_html__( 'Image', 'noisa-toolkit' ), 'id' => 'share_image', 'type' => 'add_image', 'source' => 'media_libary', // all, media_libary, external_link 'desc' => esc_html__('Use images that are at least 1200 x 630 pixels for the best display on high resolution devices. At the minimum, you should use images that are 600 x 315 pixels to display link page posts with larger images. If share data isn\'t visible on Facebook, please use this link:', 'noisa-toolkit' ) . '<br>'.'<a href="https://developers.facebook.com/tools/debug/" target="_blank">Facbook Debuger</a>', 'dependency' => array( "element" => '_fb_sharing', "value" => array( true ) ) ), /* Title */ array( 'name' => esc_html__( 'Title', 'noisa-toolkit' ), 'id' => '_share_title', 'type' => 'text', 'std' => '', 'desc' => esc_html__( 'A clear title without branding or mentioning the domain itself.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_fb_sharing', "value" => array( true ) ) ), /* Video */ array( 'name' => esc_html__( 'Video', 'noisa-toolkit' ), 'id' => '_share_video', 'type' => 'text', 'std' => '', 'desc' => esc_html__( 'Video URL.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_fb_sharing', "value" => array( true ) ) ), /* Short Description */ array( 'name' => esc_html__( 'Short Description', 'noisa-toolkit' ), 'id' => '_share_description', 'type' => 'textarea', 'tinymce' => 'false', 'std' => '', 'height' => '80', 'desc' => esc_html__( 'A clear description, at least two sentences long.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_fb_sharing', "value" => array( true ) ) ), array( 'type' => 'tab_close' ), ), /* ================================================== Tab Layout ================================================== */ 'layout_tab' => array( array( 'name' => esc_html__( 'Layout', 'noisa-toolkit' ), 'id' => 'tab-layout', 'type' => 'tab_open', ), /* Layout */ array( 'name' => esc_html__( 'Page Layout', 'noisa-toolkit' ), 'id' => '_layout', 'type' => 'select_image', 'std' => 'wide', 'images' => array( array( 'id' => 'thin', 'title' => esc_html__( 'Narrow', 'noisa-toolkit' ), 'image' => esc_url( RASCALS_TOOLKIT_URL ) . '/assets/images/icons/narrow.png' ), array( 'id' => 'main-right', 'title' => esc_html__( 'Content with sidebar on left side', 'noisa-toolkit' ), 'image' => esc_url( RASCALS_TOOLKIT_URL ) . '/assets/images/icons/left-sidebar.png' ), array( 'id' => 'main-left', 'title' => esc_html__( 'Content with sidebar on right side', 'noisa-toolkit' ), 'image' => esc_url( RASCALS_TOOLKIT_URL ) . '/assets/images/icons/right-sidebar.png' ), array( 'id' => 'wide', 'title' => esc_html__( 'Wide Layout', 'noisa-toolkit' ), 'image' => esc_url( RASCALS_TOOLKIT_URL ) . '/assets/images/icons/wide.png' ), array( 'id' => 'vc', 'title' => esc_html__( 'WPBakery Page Builder', 'noisa-toolkit' ), 'image' => esc_url( RASCALS_TOOLKIT_URL ) . '/assets/images/icons/vc.png' ), ), 'desc' => esc_html__( 'Choose the page layout.', 'noisa-toolkit' ), ), /* Sidebars */ array( 'name' => esc_html__( 'Custom Sidebar', 'spectra_plugin' ), 'id' => '_custom_sidebar', 'type' => 'select_array', 'std' => '', 'options' => array( array( 'name' => esc_html__( 'Primary Sidebar', 'spectra_plugin' ), 'value' => '_default' ), ), 'array' => $rascals_mb->getSidebars( 'noisa_panel_opts' ), 'key' => 'value', 'separator' => true, 'desc' => esc_html__( 'Select custom or primary sidebar.', 'spectra_plugin' ), 'dependency' => array( "element" => '_layout', "value" => array( 'main-right', 'main-left' ) ) ), array( 'type' => 'tab_close' ), ), /* ================================================== Tab Intro ================================================== */ 'intro_tab' => array( array( 'name' => esc_html__( 'Intro/Hero', 'noisa-toolkit' ), 'id' => 'tab-hero', 'type' => 'tab_open', ), /* Select intro type */ array( 'name' => esc_html__( 'Intro Type', 'noisa-toolkit' ), 'id' => '_intro_type', 'type' => 'select', 'std' => 'intro_none', 'options' => noisa_toolkit_mb_intro_opts(), 'separator' => true, 'desc' => esc_html__('Select intro type.', 'noisa-toolkit' ), ), /* Background image */ array( 'name' => esc_html__( 'Background Image', 'noisa-toolkit' ), 'id' => '_intro_image', 'type' => 'add_image', 'std' => '', 'source' => 'media_libary', // all, media_libary, external_link 'separator' => true, 'desc' => esc_html__( 'Header image.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_full_image', 'intro_image', 'intro_full_image_content', 'intro_image_zoom_out', 'intro_page_title', 'intro_youtube', 'intro_youtube_fullscreen', 'artist_profile' ) ) ), /* Height */ array( 'name' => esc_html__( 'Height', 'noisa-toolkit' ), 'id' => '_min_height', 'type' => 'range', 'std' => '500', 'min' => 100, 'max' => 1200, 'unit' => esc_html__( 'px', 'noisa-toolkit' ), 'separator' => true, 'desc' => esc_html__( 'Header section min. height.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_slider', 'intro_image', 'intro_youtube', 'intro_image_zoom_out' ) ) ), /* Overlay */ array( 'name' => esc_html__( 'Overlay', 'noisa-toolkit' ), 'id' => '_overlay', 'type' => 'select', 'std' => 'disabled', 'options' => array( array( 'name' => esc_html__( 'Disabled', 'noisa-toolkit' ), 'value' => 'disabled' ), array( 'name' => esc_html__( 'Gradient', 'noisa-toolkit' ), 'value' => 'gradient' ), array( 'name' => esc_html__( 'Grid', 'noisa-toolkit' ), 'value' => 'grid' ), array( 'name' => esc_html__( 'Animated Noise', 'noisa-toolkit' ), 'value' => 'noise' ), array( 'name' => esc_html__( 'Dots', 'noisa-toolkit' ), 'value' => 'dots' ) ), 'separator' => true, 'desc' => esc_html__( 'Select overlay type.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_slider', 'intro_image', 'intro_full_image', 'intro_full_slider', 'intro_full_image_content', 'intro_youtube', 'intro_youtube_fullscreen', 'intro_image_zoom_out', 'intro_page_title', 'artist_profile', 'featured_post' ) ) ), /* Gradient */ array( 'id' => array( array( 'id' => '_from', 'std' => '#171719'), array( 'id' => '_to', 'std' => 'rgba(23,23,25,0.2)'), array( 'id' => '_direction', 'std' => '0'), ), 'type' => 'gradient', 'separator' => true, 'desc' => esc_html__( 'Select gradient colors (From,To,Direction)', 'noisa-toolkit' ), 'dependency' => array( "element" => '_overlay', "value" => array( 'gradient' ) ) ), /* Image Effect */ array( 'name' => esc_html__( 'Image Effect', 'noisa-toolkit' ), 'id' => '_image_effect', 'type' => 'select', 'std' => 'disabled', 'options' => array( array( 'name' => esc_html__( 'Disabled', 'noisa-toolkit' ), 'value' => 'disabled' ), array( 'name' => esc_html__( 'Zoom', 'noisa-toolkit' ), 'value' => 'zoom' ), array( 'name' => esc_html__( 'Parallax', 'noisa-toolkit' ), 'value' => 'parallax' ) ), 'desc' => esc_html__( 'Select Image effect.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_image', 'intro_full_image', 'intro_full_image_content', 'intro_page_title', 'artist_profile' ) ) ), /* Animated */ array( 'name' => esc_html__( 'Animated', 'noisa-toolkit' ), 'id' => '_animated', 'type' => 'switch_button', 'std' => 'off', 'separator' => true, 'desc' => esc_html__( 'Enable animated effects.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_slider', 'intro_full_slider', 'intro_image', 'intro_full_image', 'intro_full_image_content', 'intro_youtube', 'intro_youtube_fullscreen', 'intro_image_zoom_out' ) ) ), /* Scroll Icon */ array( 'name' => esc_html__( 'Scroll Icon', 'noisa-toolkit' ), 'id' => '_scroll_icon', 'type' => 'switch_button', 'std' => 'off', 'separator' => true, 'desc' => esc_html__( 'If this opion is on, you should see scroll icon on intro section.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_full_image', 'intro_youtube_fullscreen' ) ) ), /* Header Titile */ array( 'name' => esc_html__( 'Header Title', 'noisa-toolkit' ), 'id' => '_intro_title', 'type' => 'textarea', 'std' => '', 'tinymce' => 'false', 'height' => '40', 'separator' => true, 'desc' => esc_html__( 'Add intro title.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_image', 'intro_full_image', 'intro_youtube', 'intro_youtube_fullscreen', 'intro_image_zoom_out' ) ) ), /* Header Subtitle */ array( 'name' => esc_html__( 'Header Subtitle', 'noisa-toolkit' ), 'id' => '_intro_subtitle', 'type' => 'textarea', 'std' => '', 'tinymce' => 'false', 'height' => '40', 'separator' => true, 'desc' => esc_html__( 'Add intro subtitle.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_image', 'intro_full_image', 'intro_youtube', 'intro_youtube_fullscreen', 'intro_image_zoom_out' ) ) ), /* Captions Align */ array( 'name' => esc_html__( 'Captions Align', 'noisa-toolkit' ), 'id' => '_captions_align', 'type' => 'select', 'std' => 'left', 'options' => array( array( 'name' => esc_html__( 'Left', 'noisa-toolkit' ), 'value' => 'left' ), array( 'name' => esc_html__( 'Center', 'noisa-toolkit' ), 'value' => 'center' ) ), 'separator' => true, 'desc' => esc_html__( 'Caption Align.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_full_image', 'intro_youtube_fullscreen', 'intro_full_slider' ) ) ), /* Extra Classes */ array( 'name' => esc_html__( 'Extra Classes', 'noisa-toolkit' ), 'id' => '_caption_classes', 'type' => 'textarea', 'std' => '', 'tinymce' => 'false', 'height' => '40', 'separator' => true, 'desc' => esc_html__( 'Style intro captions - add a class name and refer to it in custom CSS.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_image', 'intro_full_image', 'intro_youtube', 'intro_youtube_fullscreen', 'intro_image_zoom_out' ) ) ), /* Slider */ array( 'name' => esc_html__( 'Slider', 'noisa-toolkit' ), 'id' => '_slider_id', 'type' => 'select_array', 'std' => '', 'options' => $rascals_mb->getSlider( 'noisa_slider' ), 'separator' => true, 'desc' => esc_html__( 'Select your slider; images min width must be 1920. If there are no sliders available, then you can add a slider and images using Slider custom posts menu on the left.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_full_slider', 'intro_slider' ) ) ), /* Rev Slider */ array( 'name' => esc_html__( 'Revolution Slider', 'noisa-toolkit' ), 'id' => '_revslider_id', 'type' => 'select_array', 'options' => $rascals_mb->getRevoSliders(), 'std' => '', 'separator' => true, 'desc' => esc_html__( 'Select Revo Slider.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'revslider' ) ) ), /* Background */ array( 'name' => esc_html__( 'Background', 'noisa-toolkit' ), 'id' => '_intro_bg', 'type' => 'bg_generator', 'std' => '', 'separator' => true, 'desc' => esc_html__( 'Generate intro background.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_content' ) ) ), /* Header Content */ array( 'name' => esc_html__( 'Header Content', 'noisa-toolkit' ), 'id' => '_intro_content', 'type' => 'textarea', 'std' => '', 'tinymce' => 'true', 'height' => '200', 'height' => '100', 'separator' => true, 'desc' => esc_html__( 'Add text to the intro section below the title.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_content', 'intro_full_image_content' ) ) ), /* Map */ array( 'name' => esc_html__( 'Address', 'noisa-toolkit' ), 'id' => '_map_address', 'type' => 'textarea', 'std' => 'Level 13, 2 Elizabeth St, Melbourne Victoria 3000 Australia', 'tinymce' => 'false', 'height' => '40', 'separator' => true, 'desc' => esc_html__( 'Add address to Google Map.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'gmap' ) ) ), /* Youtube */ array( 'name' => esc_html__( 'YouTube ID', 'noisa-toolkit' ), 'id' => '_yt_id', 'type' => 'text', 'std' => '', 'separator' => true, 'desc' => esc_html__( 'Add YouTube movie ID e.g. BsekcY04xvQ.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_youtube', 'intro_youtube_fullscreen', 'artist_profile', 'intro_page_title' ) ) ), /* Intro tabs */ array( 'name' => esc_html__( 'Intro Tabs', 'noisa-toolkit' ), 'id' => '_intro_tabs', 'type' => 'textarea', 'std' => '', 'tinymce' => 'false', 'height' => '100', 'separator' => true, 'desc' => esc_html__( 'Add intro tabs: ROW_ID|Title. ROW_ID must correspond with Visual Composer ROW ID (must be the same). ex:', 'noisa-toolkit' ) . '<br><pre><code>bio|Biography releases|My Releases gallery|Gallery podcasts|Podcasts</code></pre>', 'dependency' => array( "element" => '_intro_type', "value" => array( 'artist_profile' ) ) ), /* Artist Profile */ array( 'name' => esc_html__( 'Artist Image', 'noisa-toolkit' ), 'id' => '_artist_image', 'type' => 'add_image', 'std' => '', 'source' => 'media_libary', // all, media_libary, external_link 'separator' => true, 'desc' => esc_html__( 'Artist profile image.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'artist_profile' ) ) ), /* Play Music Button */ array( 'name' => esc_html__( 'Play Music Button', 'noisa-toolkit' ), 'id' => '_intro_tracks_id', 'type' => 'select_array', 'std' => '', 'options' => $rascals_mb->getTracks( 'noisa_tracks' ), 'separator' => true, 'desc' => esc_html__( 'Select your tracks, then "Play" button will be visible. If there are no tracks available, then you can add a audio tracks using TRACKS custom posts menu on the left.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'artist_profile' ) ) ), /* Social Buttons */ array( 'name' => esc_html__( 'Social Buttons', 'noisa-toolkit' ), 'id' => '_social_links', 'type' => 'textarea', 'std' => '', 'tinymce' => 'false', 'height' => '100', 'separator' => true, 'desc' => esc_html__( 'Add social button: icon_name|http://yourlink. ex:', 'noisa-toolkit' ) . '<br><pre><code>twitter|http://twitter.com facebook|http://facebook.com googleplus|http://google.com soundcloud|http://soundcloud.com</code></pre>', 'dependency' => array( "element" => '_intro_type', "value" => array( 'artist_profile' ) ) ), /* Play Music Button Title */ array( 'name' => esc_html__( 'Play Music Button Title', 'noisa-toolkit' ), 'id' => '_intro_play_button_title', 'type' => 'text', 'std' => 'Play my tracks', 'separator' => true, 'desc' => esc_html__( 'Button title.', 'noisa-toolkit' ), 'dependency' => array( "element" => '_intro_type', "value" => array( 'artist_profile' ) ) ), /* Buttons */ array( 'name' => esc_html__( 'Buttons', 'noisa-toolkit' ), 'id' => '_intro_buttons', 'std' => '', 'type' => 'textarea', 'tinymce' => 'false', 'height' => '100', 'separator' => true, 'desc' => esc_html__( 'Add custom button: title|http://yourlink|target. ex:', 'noisa-toolkit' ) . '<br><pre><code>New Window|http://google.com|_blank About US|http://link.com|_self</code></pre>', 'dependency' => array( "element" => '_intro_type', "value" => array( 'intro_image', 'intro_full_image', 'intro_youtube', 'intro_youtube_fullscreen', 'intro_image_zoom_out', 'artist_profile' ) ) ), array( 'type' => 'tab_close' ), ) ); if ( isset( $common_metaboxes[$tab_name] ) ) { return $common_metaboxes[$tab_name]; } return; }
| ver. 1.4 |
Github
|
.
| PHP 8.5.7 | Generation time: 0 |
proxy
|
phpinfo
|
Settings