Файловый менеджер - Редактировать - /home/admin/domains/octawebtools.com/public_html/wp-content/themes/foxiz/templates/blocks/gallery.php
�азад
<?php /** Don't load directly */ defined( 'ABSPATH' ) || exit; if ( ! function_exists( 'foxiz_get_simple_gallery' ) ) { /** * @param array $settings * @param null $_query * * @return false|string */ function foxiz_get_simple_gallery( $settings = [], $_query = null ) { $settings = wp_parse_args( $settings, [ 'uuid' => '', 'name' => 'simple_gallery', ] ); if ( empty( $settings['columns'] ) ) { $settings['columns'] = 3; } if ( empty( $settings['column_gap'] ) ) { $settings['column_gap'] = 20; } if ( ! empty( $settings['center_mode'] ) && ( '-1' === (string) $settings['center_mode'] ) ) { $settings['center_mode'] = false; } $settings['classes'] = 'block-simple-gallery'; if ( ! empty( $settings['image_style'] ) ) { $settings['classes'] .= ' is-style-' . $settings['image_style']; } if ( ! empty( $settings['feat_lazyload'] ) && strpos( $settings['feat_lazyload'], 'e-' ) !== false ) { $settings['eager_images'] = (int) str_replace( 'e-', '', $settings['feat_lazyload'] ); } $is_lazy = foxiz_get_option( 'lazy_load' ); $loop_index = 1; ob_start(); foxiz_block_open_tag( $settings ); foxiz_block_inner_open_tag( $settings ); if ( is_array( $settings['gallery_data'] ) ) { foreach ( $settings['gallery_data'] as $item ) { if ( ! empty( $settings['eager_images'] ) ) { $settings['feat_lazyload'] = ( $loop_index <= $settings['eager_images'] ) ? 'none' : '1'; $loop_index ++; } if ( ! empty( $settings['feat_lazyload'] ) ) { $is_lazy = ( 'none' === $settings['feat_lazyload'] ) ? false : true; } echo foxiz_get_simple_gallery_item( $item, $is_lazy ); } } foxiz_block_inner_close_tag( $settings ); foxiz_block_close_tag(); return ob_get_clean(); } } if ( ! function_exists( 'foxiz_get_simple_gallery_item' ) ) { function foxiz_get_simple_gallery_item( $item = [], $is_lazy = true ) { $output = '<div class="simple-gallery-item">'; if ( ! empty( $item['image']['id'] ) ) { if ( ! $is_lazy ) { $image = wp_get_attachment_image( $item['image']['id'], 'full', false, [ 'loading' => 'eager' ] ); } else { $image = wp_get_attachment_image( $item['image']['id'], 'full', false, [ 'loading' => 'lazy' ] ); } } elseif ( ! empty( $image['url'] ) ) { if ( ! $is_lazy ) { $attr = 'loading ="eager"'; } else { $attr = 'loading ="lazy"'; } $image = '<img src="' . $image['url'] . '" alt="' . esc_html__( 'gallery image', 'foxiz' ) . '" ' . $attr . '>'; } if ( ! empty( $image ) ) { $output .= '<div class="simple-gallery-image">'; if ( ! empty( $item['link']['url'] ) ) { $output .= foxiz_render_elementor_link( $item['link'], $image, '', $item['title'] ); } else { $output .= $image; } if ( ! empty( $item['meta'] ) ) { $output .= '<div class="p-categories simple-gallery-meta">' . esc_html( $item['meta'] ) . '</div>'; } $output .= '</div>'; } if ( ! empty( $item['title'] ) ) { $output .= '<span class="simple-gallery-title h4">'; if ( ! empty( $item['link']['url'] ) ) { $output .= foxiz_render_elementor_link( $item['link'], esc_html( $item['title'] ) ); } else { $output .= foxiz_strip_tags( $item['title'] ); } $output .= '</span>'; } if ( ! empty( $item['description'] ) ) { $output .= '<span class="simple-gallery-desc">'; $output .= foxiz_strip_tags( $item['description'] ); $output .= '</span>'; } $output .= '</div>'; return $output; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генераци� �траницы: 0 |
proxy
|
phpinfo
|
�а�тройка