humanmade/modular-page-builder

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Modular Page Builder

Modular page builder for WordPress

image

Basic usage

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;


Revisions

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.

Custom Modules
Extra Customization
Available Field Types
Text Field

Example.

y(
'name'  => 'caption',
'label' => __( 'Test Text Field', 'mpb' ),
'type'  => 'text'

Select Field

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' )
    )
)

Image Field

Example

y(
'name'  => 'image',
'label' => __( 'Test Image', 'mbp' ),
'type'  => 'attachment',
'config' => array(
    'button_text' => __( 'Custom Button Text', 'mbp' ),
)


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.