Name: modular-page-builder
Owner: Human Made
Description: Modular page builder for WordPress
Created: 2015-09-14 13:22:55.0
Updated: 2018-05-15 18:11:50.0
Pushed: 2017-05-19 10:49:32.0
Homepage: null
Size: 799
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Modular page builder for WordPress
Out of the box, modules are available for header, text and image only.
You must add post type support for the builder add_post_type_support( 'page', 'modular-page-builder' );
You must handle the output of the page builder data manually. Here is an example of simply replacing the post content.
filter( 'the_content', function( $content, $id = null ) {
$id = $id ?: get_the_ID();
if ( post_type_supports( get_post_type( $id ), 'modular-page-builder' ) ) {
$plugin = ModularPageBuilder\Plugin::get_instance()->get_builder( 'modular-page-builder' );
$content = $plugin->get_rendered_data( $id );
}
return $content;
By default, WordPress does NOT revision post meta. If you want to revision the page builder data we reccommend you use the WP-Post-Meta-Revisions plugin. You just need to install and activate it, we have handled registering of the revisioned meta keys.
ModularPageBuilder\Modules\Module
.render
method.$name
property the same as module-name
$attr
array.edit-form-default.js
view.window.modularPageBuilder.editViewMap
. Where the property is your module name and the view is your view object.window.modularPageBuilder.views.ModuleEdit
.text
textarea
select
html
link
attachment
post_select
Example.
y(
'name' => 'caption',
'label' => __( 'Test Text Field', 'mpb' ),
'type' => 'text'
Example.
y(
'name' => 'select_test',
'label' => __( 'Select Test', 'mbp' ),
'type' => 'select',
'config' => array(
'options' => array(
array( 'value' => 'a', 'text' => 'Option A' ),
array( 'value' => 'b', 'text' => 'Option B' )
)
)
Example
y(
'name' => 'image',
'label' => __( 'Test Image', 'mbp' ),
'type' => 'attachment',
'config' => array(
'button_text' => __( 'Custom Button Text', 'mbp' ),
)