Home>Support>Multiple wysiwyg editors within custom post type having the page builder

Multiple wysiwyg editors within custom post type having the page builder

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hello!

First of all, awesome plugin guys!

I’m looking to apply the page builder to multiple wysiwyg editors within a custom post type.
Earlier I found a similar post about this: https://siteorigin.com/thread/two-sections-in-a-post-editable-by-pagebuilder/
but I need it to work without a plugin.

The setup I have is;

Single post type
http://domain/project/post/

Sub pages of the post type targeting a specific template by url rewrite;
http://domain/project/post/design
http://domain/project/post/build
http://domain/project/post/result

So I need to have 4 wysiwyg editors to display the content (1 for the regular page, 3 for the sub pages)
The regular one works fine obviously as the page builder plugin is attached to the custom post type.

I have the following code in my functions.php to create an extra wysiwyg editor;

// ADD DESIGN EDITOR
function design_editor($post) {
    echo '<h1>Design</h1>';
    $content = get_post_meta($post->ID, 'design_content' , true ) ;
    wp_editor( $content, 'design_content' );
}

add_action( 'edit_form_advanced', 'design_editor' );

function design_content_save_postdata($post_id) {
  if (!empty($_POST['design_content'])) {
    $data=htmlspecialchars($_POST['design_content']);
    update_post_meta($post_id, 'design_content', $data );
  }
}

add_action('save_post', 'design_content_save_postdata');

And I output this code in single-project-design.php like this;

$content = get_post_meta(get_the_ID(), 'design_content' , true );
$content = htmlspecialchars_decode($content);
$content = wpautop( $content );
echo $content;

Up to this point it all works but how can I apply the “page builder tab” to my design editor so the output is styled by the page builder?

I tried to be as specific as possible and looking forward to your reply.
Thanks in advance!

– Luke

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More