%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom645759/wp-content/plugins/fusion-builder/shortcodes/
Upload File :
Create Path :
Current File : /dom645759/wp-content/plugins/fusion-builder/shortcodes/fusion-code-block.php

<?php
/**
 * Add an element to fusion-builder.
 *
 * @package fusion-builder
 * @since 1.0
 */

if ( fusion_is_element_enabled( 'fusion_code' ) ) {

	if ( ! class_exists( 'FusionSC_Code_Block' ) ) {
		/**
		 * Shortcode class.
		 *
		 * @since 1.0
		 */
		class FusionSC_Code_Block extends Fusion_Element {

			/**
			 * Constructor.
			 *
			 * @access public
			 * @since 1.0
			 */
			public function __construct() {
				parent::__construct();
				add_shortcode( 'fusion_code', [ $this, 'render' ] );
			}

			/**
			 * Render the shortcode
			 *
			 * @access public
			 * @since 1.0
			 * @param  array  $args    Shortcode parameters.
			 * @param  string $content Content between shortcode.
			 * @return string          HTML output.
			 */
			public function render( $args, $content = '' ) {
				$content = fusion_decode_if_needed( $content );
				$content = apply_filters( 'fusion_shortcode_content', $content, 'fusion_code', $args );

				$this->on_render();

				return apply_filters( 'fusion_element_code_block_content', do_shortcode( html_entity_decode( $content, ENT_QUOTES ) ), $args );
			}
		}
	}

	new FusionSC_Code_Block();

}

/**
 * Map shortcode to Avada Builder.
 *
 * @since 1.0
 */
function fusion_element_code_block() {
	fusion_builder_map(
		[
			'name'        => esc_attr__( 'Code Block', 'fusion-builder' ),
			'shortcode'   => 'fusion_code',
			'icon'        => 'fusiona-code',
			'escape_html' => true,
			'help_url'    => 'https://classic.avada.com/documentation/code-block-element/',
			'params'      => [
				[
					'type'        => 'code',
					'heading'     => esc_attr__( 'Code', 'fusion-builder' ),
					'description' => __( 'Add content for this code block. <strong>NOTE:</strong> The contents of this code block can only be saved and rendered on the frontend if the post author has the <code>unfiltered_html</code> capability. Typically, this capability is only granted to Administrator users on single-site WordPress installs and Super Admins on multisite installs.', 'fusion-builder' ),
					'param_name'  => 'element_content',
					'value'       => '',
				],
				'fusion_conditional_render_placeholder' => [],
			],
		]
	);
}
add_action( 'fusion_builder_before_init', 'fusion_element_code_block' );

Zerion Mini Shell 1.0