HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: /volume1/web/wordpress/wp-content/plugins/brizy/content/shortcode-to-placeholder-processor.php
<?php

class Brizy_Content_ShortcodeToPlaceholderProcessor implements Brizy_Editor_Content_ProcessorInterface {
    /**
     * @param string $content
     * @param Brizy_Content_Context $context
     *
     * @return mixed|string
     */
    public function process( $content, Brizy_Content_Context $context ) {

		// Transform [brizy_shortcode_name attr="val"] to {{editor_shortcode_name attr='val'}}
        $regex = '@(\[)(brizy_)(.*?)(\])@';

        $content = preg_replace_callback( $regex, function ( $matches ) {
        	$shortcode = $matches[0];
        	$shortcode = str_replace( [ '[brizy', ']' ], [ '{{editor', '}}' ], $shortcode );
        	$shortcode = str_replace( '"', "'", $shortcode );

            return $shortcode;

        }, $content  );

        return $content;
    }
}