File manager - Edit - /home/verseaumee/TF89388/wp-content/plugins/noisa-toolkit/includes/metabox-fields/media_manager/media_manager_slider.php
Back
<?php /** * Media Manager Slider Field * * @author Rascals Themes * @category Core * @package Noisa Toolkit * @version 1.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed diCustomizer } if ( ! function_exists( 'rascals_media_manager_slider' ) ): function rascals_media_manager_slider( $type, $id, $item, $options, $custom ) { /* Display only if the type matches */ if ( $type === 'slider' ) { $toolkit = noisaToolkit(); /* Output */ $output = ''; /* Defaults */ $defaults = array( 'custom' => $custom, 'title' => '', 'youtube_id' => '', 'subtitle' => '', 'slider_button_url' => '', 'slider_button_target' => '_self', 'slider_button_title' => esc_html__( 'View More', 'noisa-toolkit' ) ); /* Set default options */ if ( isset( $options ) && is_array( $options ) ) { $options = array_merge( $defaults, $options ); } else { $options = $defaults; } /* Helpers */ /* Target options */ $target_options = array( array('name' => esc_html__( 'Same Window/Tab', 'noisa-toolkit' ), 'value' => '_self'), array('name' => esc_html__( 'New Window/Tab', 'noisa-toolkit' ), 'value' => '_blank') ); /* Yes/No */ $yes_no_options = array( array('name' => esc_html__( 'No', 'noisa-toolkit' ), 'value' => 'no'), array('name' => esc_html__( 'Yes', 'noisa-toolkit' ), 'value' => 'yes') ); $image_type = array( array('name' => 'Image', 'value' => 'image'), array('name' => 'Image lightbox', 'value' => 'lightbox'), array('name' => 'Image with custom media', 'value' => 'media'), array('name' => 'Custom link', 'value' => 'link'), array('name' => 'Custom link (new window)', 'value' => 'link_blank'), ); /* IMAGE META ------------------------------------------------------------------------------*/ /* Get Image Data */ $meta = wp_get_attachment_metadata( $id ); $image_data = wp_get_attachment_image_src( $id ); $output .= ' <div class="mm-item mm-item-editor" id="' . esc_attr( $id ) . '"> <div class="mm-item-preview"> <div class="mm-item-image"> <div class="mm-centered"> <a href="' . esc_url( $item->guid ) . '" target="_blank"><img src="' . esc_url( $image_data[0] ) . '" /></a> </div> </div> </div> </div>'; /* Meta */ $output .= '<div id="mm-editor-meta">'; $output .= '<span><strong>' . esc_html__( 'File name:', 'noisa-toolkit' ) . '</strong> ' . esc_html( basename( $item->guid ) ) . '</span>'; $output .= '<span><strong>' . esc_html__( 'File type:', 'noisa-toolkit' ) . '</strong> ' . esc_html( $item->post_mime_type ) . '</span>'; $output .= '<span><strong>' . esc_html__( 'Upload date:', 'noisa-toolkit' ) . '</strong> ' . mysql2date( get_option( 'date_format' ), $item->post_date ) . '</span>'; if ( is_array( $meta ) && array_key_exists( 'width', $meta ) && array_key_exists('height', $meta ) ) { $output .= '<span><strong>' . esc_html__( 'Dimensions:', 'noisa-toolkit' ) . '</strong> ' . esc_html( $meta['width'] ) . ' x ' . esc_html( $meta['height'] ) . '</span>'; } $output .= '<span><strong>' . esc_html__( 'Image URL:', 'noisa-toolkit' ) . '</strong> <br> <a href="' . esc_url( $item->guid ) . '" target="_blank">' . esc_html__( '[IMAGE LINK]', 'noisa-toolkit' ) . '</a> </span>'; $output .= '</div>'; /* FIELDS ------------------------------------------------------------------------------*/ $output .= '<fieldset class="rascalsbox">'; /* Title */ $output .= ' <div class="box-row clearfix"> <div class="box-row-input"> <div class="box-tc box-tc-label"> <label for="mm-image-title">' . esc_html__( 'Title', 'noisa-toolkit' ) . '</label> </div> <div class="box-tc box-tc-input"> <textarea id="mm-image-title" name="title" style="min-height:40px">'. wp_kses_post( $options['title'] ) .'</textarea> <p class="help-box">' . esc_html__( 'Image title.', 'noisa-toolkit' ) . '</p> </div> </div> <div class="box-row-line"></div> </div>'; /* Video BG */ $output .= ' <div class="box-row clearfix"> <div class="box-row-input"> <div class="box-tc box-tc-label"> <label for="mm-video-bg">' . esc_html__( 'YouTube Video Background', 'noisa-toolkit' ) . '</label> </div> <div class="box-tc box-tc-input"> <input type="text" id="mm-video-bg" name="youtube_id" value="' . esc_attr( $options['youtube_id'] ) . '" /> <p class="help-box">' . esc_html__( 'Type Youtube video ID e.g: 1XZGulDxz9o. Replace image on video background.', 'noisa-toolkit' ) . '</p> </div> </div> <div class="box-row-line"></div> </div>'; /* Subtitle */ $output .= ' <div class="box-row clearfix"> <div class="box-row-input"> <div class="box-tc box-tc-label"> <label for="mm-image-subtitle">' . esc_html__( 'Subtitle', 'noisa-toolkit' ) . '</label> </div> <div class="box-tc box-tc-input"> <textarea id="mm-image-subtitle" name="subtitle" style="min-height:40px">'. wp_kses_post( $options['subtitle'] ) .'</textarea> <p class="help-box">' . esc_html__( 'Image subtitle.', 'noisa-toolkit' ) . '</p> </div> </div> <div class="box-row-line"></div> </div>'; /* Button Title */ $output .= ' <div class="box-row clearfix"> <div class="box-row-input"> <div class="box-tc box-tc-label"> <label for="mm-slider_button_title">' . esc_html__( 'Slider Button Title', 'noisa-toolkit' ) . '</label> </div> <div class="box-tc box-tc-input"> <input type="text" id="mm-slider_button_title" name="slider_button_title" value="' . esc_attr( $options['slider_button_title'] ) . '" /> <p class="help-box">' . esc_html__( 'Paste slider button URL.', 'noisa-toolkit' ) . '<br>' . esc_html__( 'NOTE: Displayed only on Intro slider section.', 'noisa-toolkit' ) . '</p> </div> </div> <div class="box-row-line"></div> </div>'; /* Button Link */ $output .= ' <div class="box-row clearfix"> <div class="box-row-input"> <div class="box-tc box-tc-label"> <label for="mm-slider_button_url">' . esc_html__( 'Slider Button URL', 'noisa-toolkit' ) . '</label> </div> <div class="box-tc box-tc-input"> <input type="text" id="mm-slider_button_url" name="slider_button_url" value="' . esc_attr( $options['slider_button_url'] ) . '" /> <p class="help-box">' . esc_html__( 'Paste slider button URL.', 'noisa-toolkit' ) . '<br>' . esc_html__( 'NOTE: Displayed only on Intro slider section.', 'noisa-toolkit' ) . '</p> </div> </div> <div class="box-row-line"></div> </div>'; /* Slider Button target */ $output .= ' <div class="box-row clearfix"> <div class="box-row-input"> <div class="box-tc box-tc-label"> <label for="mm-slider-button-target">' . esc_html__( 'Slider Button Target', 'noisa-toolkit' ) . '</label> </div> <div class="box-tc box-tc-input"> <select id="mm-slider-button-target" name="slider_button_target" size="1" class="box-select">'; foreach ( $target_options as $option ) { if ( $options['slider_button_target'] == $option['value'] ) $selected = 'selected'; else $selected = ''; $output .= "<option " . esc_attr( $selected ) . " value='" . esc_attr( $option['value'] ) . "'>" . esc_attr( $option['name'] ) . "</option>"; } $output .= '</select>'; $output .= '<p class="help-box">' . esc_html__( 'Select buton target.', 'noisa-toolkit' ) . '<br>' . esc_html__( 'NOTE: Displayed only on Intro slider section.', 'noisa-toolkit' ) . '</p> </div> </div> <div class="box-row-line"></div> </div>'; $output .= '</fieldset>'; return $output; } } endif;
| ver. 1.4 |
Github
|
.
| PHP 8.5.7 | Generation time: 0 |
proxy
|
phpinfo
|
Settings