Created
January 10, 2015 10:36
-
-
Save mototeam/e757e1df352a9547839f to your computer and use it in GitHub Desktop.
MotoPress Custom Layouts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: MotoPress Custom Layouts | |
* Plugin URI: http://www.getmotopress.com/ | |
* Description: This example describes how to add custom predefined layouts. | |
* Version: 1.0 | |
* Author: MotoPress Team | |
* Author URI: http://www.getmotopress.com/ | |
* License: GPL2 or later | |
*/ | |
function motopress_custom_layouts($motopressCELibrary) { | |
$defaultText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut nibh mi, viverra et nibh nec, aliquet mollis urna. Fusce vehicula malesuada cursus. Nullam in aliquam risus.'; | |
$myCustomLayout1Content = <<<CONTENT | |
[mp_row] | |
[mp_span col="4"] | |
[mp_row_inner] | |
[mp_span_inner col="12"] | |
[mp_image size="full" link_type="custom_url" link="#" target="false" align="left"] | |
[/mp_span_inner] | |
[/mp_row_inner] | |
[mp_row_inner] | |
[mp_span_inner col="12"] | |
[mp_text] | |
{$defaultText} | |
[/mp_text] | |
[/mp_span_inner] | |
[/mp_row_inner] | |
[/mp_span] | |
[mp_span col="4"] | |
[mp_row_inner] | |
[mp_span_inner col="12"] | |
[mp_image size="full" link_type="custom_url" link="#" target="false" align="left"] | |
[/mp_span_inner] | |
[/mp_row_inner] | |
[mp_row_inner] | |
[mp_span_inner col="12"] | |
[mp_text] | |
{$defaultText} | |
[/mp_text] | |
[/mp_span_inner] | |
[/mp_row_inner] | |
[/mp_span] | |
[mp_span col="4"] | |
[mp_row_inner] | |
[mp_span_inner col="12"] | |
[mp_image size="full" link_type="custom_url" link="#" target="false" align="left"] | |
[/mp_span_inner] | |
[/mp_row_inner] | |
[mp_row_inner] | |
[mp_span_inner col="12"] | |
[mp_text] | |
{$defaultText} | |
[/mp_text] | |
[/mp_span_inner] | |
[/mp_row_inner] | |
[/mp_span] | |
[/mp_row] | |
CONTENT; | |
$myCustomLayout1 = new MPCETemplate(MPCEShortcode::PREFIX . 'custom_layout_1', "My Template 1", $myCustomLayout1Content, ''); | |
$motopressCELibrary->addTemplate(array($myCustomLayout1)); | |
} | |
add_action('mp_library', 'motopress_custom_layouts', 10, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment