1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-07-31 18:30:20 +02:00

Pages Plugin: New shortcodes added - page_author, page_slug, page_url, page_available, page_breadcrumbs, page_date

This commit is contained in:
Awilum
2012-12-09 17:38:19 +02:00
parent 16f425414f
commit c5347c31a1

View File

@@ -303,9 +303,23 @@
}
}
/**
* Add new shortcodes {page_author} {page_slug} {page_url} {page_available} {page_breadcrumbs} {page_date}
*/
Shortcode::add('page_author', 'Page::author');
Shortcode::add('page_slug', 'Page::slug');
Shortcode::add('page_url', 'Page::url');
Shortcode::add('page_available', 'Page::available');
Shortcode::add('page_breadcrumbs', 'Page::breadcrumbs');
Shortcode::add('page_date', 'Page::_date');
class Page extends Pages {
/**
* Page class
*/
class Page extends Pages {
/**
@@ -322,6 +336,10 @@
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