Файловый менеджер - Редактировать - /home/infrafs/www/wp-content/themes/trackstore/framework/modules/widgets/image-gallery/image-gallery.php
Назад
<?php class TrackStoreElatedImageGalleryWidget extends TrackStoreElatedWidget { public function __construct() { parent::__construct( 'eltd_image_gallery_widget', esc_html__( 'Elated Image Gallery Widget', 'trackstore' ), array( 'description' => esc_html__( 'Add image gallery element to widget areas', 'trackstore' ) ) ); $this->setParams(); } protected function setParams() { $this->params = array( array( 'type' => 'textfield', 'name' => 'extra_class', 'title' => esc_html__( 'Custom CSS Class', 'trackstore' ) ), array( 'type' => 'textfield', 'name' => 'widget_title', 'title' => esc_html__( 'Widget Title', 'trackstore' ) ), array( 'type' => 'dropdown', 'name' => 'type', 'title' => esc_html__( 'Gallery Type', 'trackstore' ), 'options' => array( 'grid' => esc_html__( 'Image Grid', 'trackstore' ), 'slider' => esc_html__( 'Slider', 'trackstore' ) ) ), array( 'type' => 'textfield', 'name' => 'images', 'title' => esc_html__( 'Image ID\'s', 'trackstore' ), 'description' => esc_html__( 'Add images id for your image gallery widget, separate id\'s with comma', 'trackstore' ) ), array( 'type' => 'textfield', 'name' => 'image_size', 'title' => esc_html__( 'Image Size', 'trackstore' ), 'description' => esc_html__( 'Enter image size. Example: thumbnail, medium, large, full or other sizes defined by current theme. Alternatively enter image size in pixels: 200x100 (Width x Height). Leave empty to use "thumbnail" size', 'trackstore' ) ), array( 'type' => 'dropdown', 'name' => 'enable_image_shadow', 'title' => esc_html__( 'Enable Image Shadow', 'trackstore' ), 'options' => trackstore_elated_get_yes_no_select_array() ), array( 'type' => 'dropdown', 'name' => 'image_behavior', 'title' => esc_html__( 'Image Behavior', 'trackstore' ), 'options' => array( '' => esc_html__( 'None', 'trackstore' ), 'lightbox' => esc_html__( 'Open Lightbox', 'trackstore' ), 'custom-link' => esc_html__( 'Open Custom Link', 'trackstore' ), 'zoom' => esc_html__( 'Zoom', 'trackstore' ), 'grayscale' => esc_html__( 'Grayscale', 'trackstore' ) ) ), array( 'type' => 'textarea', 'name' => 'custom_links', 'title' => esc_html__( 'Custom Links', 'trackstore' ), 'description' => esc_html__( 'Delimit links by comma', 'trackstore' ) ), array( 'type' => 'dropdown', 'name' => 'custom_link_target', 'title' => esc_html__( 'Custom Link Target', 'trackstore' ), 'options' => trackstore_elated_get_link_target_array() ), array( 'type' => 'dropdown', 'name' => 'number_of_columns', 'title' => esc_html__( 'Number of Columns', 'trackstore' ), 'options' => array( 'two' => esc_html__( 'Two', 'trackstore' ), 'three' => esc_html__( 'Three', 'trackstore' ), 'four' => esc_html__( 'Four', 'trackstore' ), 'five' => esc_html__( 'Five', 'trackstore' ), 'six' => esc_html__( 'Six', 'trackstore' ) ) ), array( 'type' => 'dropdown', 'name' => 'space_between_columns', 'title' => esc_html__( 'Space Between Items', 'trackstore' ), 'options' => trackstore_elated_get_space_between_items_array() ), array( 'type' => 'dropdown', 'name' => 'slider_navigation', 'title' => esc_html__( 'Enable Slider Navigation Arrows', 'trackstore' ), 'options' => trackstore_elated_get_yes_no_select_array( false ) ), array( 'type' => 'dropdown', 'name' => 'slider_pagination', 'title' => esc_html__( 'Enable Slider Pagination', 'trackstore' ), 'options' => trackstore_elated_get_yes_no_select_array( false ) ) ); } public function widget( $args, $instance ) { if ( ! is_array( $instance ) ) { $instance = array(); } $extra_class = ! empty( $instance['extra_class'] ) ? $instance['extra_class'] : ''; $instance['type'] = ! empty( $instance['type'] ) ? $instance['type'] : 'grid'; //prepare variables $params = ''; //is instance empty? if ( is_array( $instance ) && count( $instance ) ) { //generate shortcode params foreach ( $instance as $key => $value ) { $params .= " $key='$value' "; } } ?> <div class="widget eltd-image-gallery-widget <?php echo esc_html( $extra_class ); ?>"> <?php if ( ! empty( $instance['widget_title'] ) ) { echo wp_kses_post( $args['before_title'] ) . esc_html( $instance['widget_title'] ) . wp_kses_post( $args['after_title'] ); } echo do_shortcode( "[eltd_image_gallery $params]" ); // XSS OK ?> </div> <?php } }
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка