Changeset 3042:f30c69a00219 for plugins
- Timestamp:
- 07/05/15 11:13:58 (10 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/pages/_public.php
r2920 r3042 12 12 if (!defined('DC_RC_PATH')) { return; } 13 13 14 $core->addBehavior('coreBlogBeforeGetPosts',array('publicPages','coreBlogBeforeGetPosts')); 15 14 16 # Localized string we find in template 15 17 __('Published on'); … … 17 19 18 20 require dirname(__FILE__).'/_widgets.php'; 21 22 class publicPages 23 { 24 public static function coreBlogBeforeGetPosts($params) 25 { 26 global $core, $_ctx; 27 28 if ($core->url->type == 'search') { 29 // Add page post type for searching 30 if (isset($params['post_type'])) { 31 if (!is_array($params['post_type'])) { 32 // Convert it in array 33 $params['post_type'] = array($params['post_type']); 34 } 35 if (!in_array('page', $params['post_type'])) { 36 // Add page post type 37 $params['post_type'][] = 'page'; 38 } 39 } else { 40 // Dont miss default post type (aka post) 41 $params['post_type'] = array('post','page'); 42 } 43 } 44 } 45 } 19 46 20 47 class urlPages extends dcUrlHandlers
Note: See TracChangeset
for help on using the changeset viewer.