From 56976a9191eae873e3eb2259c49be124979bffce Mon Sep 17 00:00:00 2001 From: Awilum Date: Sun, 9 Dec 2012 18:44:59 +0200 Subject: [PATCH] Pages Plugin: New shortcodes added - page_content --- plugins/box/pages/pages.plugin.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/plugins/box/pages/pages.plugin.php b/plugins/box/pages/pages.plugin.php index 726b51d..96261b0 100644 --- a/plugins/box/pages/pages.plugin.php +++ b/plugins/box/pages/pages.plugin.php @@ -326,11 +326,12 @@ /** - * Add new shortcodes {page_author} {page_slug} {page_url} {page_date} + * Add new shortcodes {page_author} {page_slug} {page_url} {page_date} {page_content} */ Shortcode::add('page_author', 'Page::author'); Shortcode::add('page_slug', 'Page::slug'); Shortcode::add('page_url', 'Page::url'); + Shortcode::add('page_content', 'Page::_content'); Shortcode::add('page_date', 'Page::_date'); @@ -354,10 +355,6 @@ return Date::format(Pages::$page['date'], $format); } - public static function _date($attributes) { - return Page::date((isset($attributes['format'])) ? $attributes['format'] : 'Y-m-d'); - } - /** * Get author of current page @@ -484,4 +481,13 @@ return $robots; } + + public static function _date($attributes) { + return Page::date((isset($attributes['format'])) ? $attributes['format'] : 'Y-m-d'); + } + + public static function _content($attributes) { + return Page::content((isset($attributes['name']) ? $attributes['name'] : '')); + } + } \ No newline at end of file