예제 #1
0
파일: core.php 프로젝트: WaitButWhy/www
 /**
  * Update PageBuilder when switch Classic Editor to IG PageBuilder
  *
  * @return string
  */
 function text_to_pagebuilder()
 {
     if (!isset($_POST[IGNONCE]) || !wp_verify_nonce($_POST[IGNONCE], IGNONCE)) {
         return;
     }
     if (!isset($_POST['content'])) {
         return;
     }
     // $content = urldecode( $_POST['content'] );
     $content = $_POST['content'];
     $content = stripslashes($content);
     $empty_str = IG_Pb_Helper_Shortcode::check_empty_($content);
     if (strlen(trim($content)) && strlen(trim($empty_str))) {
         $builder = new IG_Pb_Helper_Shortcode();
         // remove wrap p tag
         $content = preg_replace('/^<p>(.*)<\\/p>$/', '$1', $content);
         $content = balanceTags($content);
         echo balanceTags($builder->do_shortcode_admin($content, false, true));
     } else {
         echo '';
     }
     exit;
 }