Hello,
Can I activate the page builder on multiple wp_editors (I am loading them through meta boxes)? I tried doing it via JS by customizing the variables before
builderView
.render()
.attach( {
container: container
} )
.setDataField( field )
.attachToEditor();
But so far it has proven a bit difficult.
Can you please advise?
Thank you
Best regards,
Chris
Hi Cristian,
Yes, it’s possible for SiteOrigin Page Builder to affect multiple editors.
Can you please provide me with a copy of your relevant code so I can take a look over it?
Hello Alex,
Thanks for replying – this is how I load another wp_editor:
/* Define the custom box */
add_action( ‘add_meta_boxes’, ‘testeditor_add_custom_box’ );
/* Do something with the data entered */
add_action( ‘save_post’, ‘testeditor_save_postdata’ );
function testeditor_add_custom_box() {
add_meta_box( ‘wp_editor_test_1_box’, ‘WP Editor Test #1 Box’, ‘wp_editor_meta_box’ );
}
function wp_editor_meta_box( $post ) {
// Use nonce for verification
//wp_nonce_field( plugin_basename( __FILE__ ), ‘myplugin_noncename’ );
$field_value = get_post_meta( $post->ID, ‘_wp_editor_test_1’, false );
wp_editor( $field_value[0], ‘editor2’ );
}
So then the editor appears as a TinyMCE editor as a meta box. I have tried customizing the JS code and manage to load an extra SiteOrigin Builder Panel but it doesn’t behave properly.. so maybe I am not doing it right
Thank you!