/** * Function to get shortcodes from JSON content * * @since 2.0.0 * * @return NULL * * @Param POST['data'] */ public function get_shortocodes_from_json() { $builder_data = $_POST['builder_data']; $builder_data = str_replace("\\'", "'", $builder_data); $builder_data = str_replace('\\"', '"', $builder_data); $builder_data = preg_replace("~\\\\+([\"\\'\\x00\\\\])~", '\\"', $builder_data); $builder_data = json_decode($builder_data); Fusion_Core_Shortcodes_Parser::set_content($builder_data); $response = Fusion_Core_Shortcodes_Parser::parse_column_options(); echo $response; exit; }
/** * Parser for builder elments * * @since 2.0.0 * * @prama String String having post/page content */ public static function check_builder_elements($content) { global $post; //current page/post $short_codes_content; if ($post) { self::$meta_content = get_post_meta($post->ID, "fusion_builder_content", TRUE); //get builder contents if (!empty(self::$meta_content)) { //if page built through fusion builder $short_codes_content = Fusion_Core_Shortcodes_Parser::parse_column_options(); // let the magic begin return do_shortcode($short_codes_content); } else { return $content; } } else { return $content; } }