Page-list - Version 1.7

Version Description

  • Added strip_tags parameter;
Download this release

Release Info

Developer webvitaly
Plugin Icon wp plugin Page-list
Version 1.7
Comparing to
See all releases

Code changes from version 1.6 to 1.7

Files changed (2) hide show
  1. page-list.php +18 -12
  2. readme.txt +8 -5
page-list.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Page-list
4
  Plugin URI: http://web-profile.com.ua/wordpress/plugins/page-list/
5
  Description: Show list of pages with [pagelist], [subpages], [siblings] and [pagelist_ext] shortcodes.
6
- Version: 1.6
7
  Author: webvitaly
8
  Author Email: webvitaly(at)gmail.com
9
  Author URI: http://web-profile.com.ua/wordpress/
@@ -17,7 +17,7 @@ Future features:
17
 
18
  add_action('wp_print_styles', 'page_list_add_stylesheet');
19
  function page_list_add_stylesheet() {
20
- wp_enqueue_style( 'my-style', plugins_url( '/css/page-list.css', __FILE__ ), false, '1.6', 'all' );
21
  }
22
 
23
  if ( !function_exists('pagelist_shortcode') ) {
@@ -77,7 +77,7 @@ if ( !function_exists('pagelist_shortcode') ) {
77
  $list_pages = wp_list_pages( $page_list_args );
78
 
79
  if ($list_pages) {
80
- $return = "\n".'<!-- powered by Page-list plugin ver.1.6 (wordpress.org/extend/plugins/page-list/) -->'."\n";
81
  $return .= '<ul class="page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
82
  }else{
83
  $return = '';
@@ -137,7 +137,7 @@ if ( !function_exists('subpages_shortcode') ) {
137
  $list_pages = wp_list_pages( $page_list_args );
138
 
139
  if ($list_pages) {
140
- $return = "\n".'<!-- powered by Page-list plugin ver.1.6 (wordpress.org/extend/plugins/page-list/) -->'."\n";
141
  $return .= '<ul class="page-list subpages-page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
142
  }else{
143
  $return = '';
@@ -201,7 +201,7 @@ if ( !function_exists('siblings_shortcode') ) {
201
  $list_pages = wp_list_pages( $page_list_args );
202
 
203
  if ($list_pages) {
204
- $return = "\n".'<!-- powered by Page-list plugin ver.1.6 (wordpress.org/extend/plugins/page-list/) -->'."\n";
205
  $return .= '<ul class="page-list siblings-page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
206
  }else{
207
  $return = '';
@@ -237,7 +237,8 @@ if ( !function_exists('pagelist_ext_shortcode') ) {
237
  'offset' => 0,
238
  'post_type' => 'page',
239
  'post_status' => 'publish',
240
- 'class' => ''
 
241
  ), $atts ) );
242
 
243
  if( $child_of == 'current' || $child_of == 'this' || $child_of == '0' ){
@@ -270,7 +271,8 @@ if ( !function_exists('pagelist_ext_shortcode') ) {
270
  'offset' => $offset,
271
  'post_type' => $post_type,
272
  'post_status' => $post_status,
273
- 'class' => $class
 
274
  );
275
  $list_pages = get_pages( $page_list_image_args );
276
  $list_pages_html = '';
@@ -290,7 +292,7 @@ if ( !function_exists('pagelist_ext_shortcode') ) {
290
  if( $show_content == 1 ){
291
  $content = apply_filters('the_content', $page->post_content);
292
  $content = str_replace(']]>', ']]&gt;', $content);
293
- $content = page_list_parse_content( $page->post_content, $limit_content );
294
 
295
  $list_pages_html .= '<div class="page-list-ext-item-content">'.$content.'</div>';
296
  }
@@ -298,7 +300,7 @@ if ( !function_exists('pagelist_ext_shortcode') ) {
298
  $list_pages_html .= '</div>'."\n";
299
  }
300
  if ($list_pages_html) {
301
- $return = "\n".'<!-- powered by Page-list plugin ver.1.6 (wordpress.org/extend/plugins/page-list/) -->'."\n";
302
  $return .= '<div class="page-list page-list-ext '.$class.'">'."\n".$list_pages_html."\n".'</div>';
303
  }else{
304
  $return = '';
@@ -310,7 +312,7 @@ if ( !function_exists('pagelist_ext_shortcode') ) {
310
 
311
 
312
  if ( !function_exists('page_list_parse_content') ) {
313
- function page_list_parse_content($content, $limit_content = 250) {
314
  global $more, $preview;
315
 
316
  $output = '';
@@ -319,8 +321,12 @@ if ( !function_exists('page_list_parse_content') ) {
319
  $content = explode($matches[0], $content, 2);
320
 
321
  } else {
322
- //$content_stripped = strip_tags($content); // ,'<p>'
323
- $content_stripped = $content;
 
 
 
 
324
  if( strlen($content_stripped) > $limit_content ){
325
  $pos = strpos($content_stripped, ' ', $limit_content);
326
  if ($pos !== false) {
3
  Plugin Name: Page-list
4
  Plugin URI: http://web-profile.com.ua/wordpress/plugins/page-list/
5
  Description: Show list of pages with [pagelist], [subpages], [siblings] and [pagelist_ext] shortcodes.
6
+ Version: 1.7
7
  Author: webvitaly
8
  Author Email: webvitaly(at)gmail.com
9
  Author URI: http://web-profile.com.ua/wordpress/
17
 
18
  add_action('wp_print_styles', 'page_list_add_stylesheet');
19
  function page_list_add_stylesheet() {
20
+ wp_enqueue_style( 'page-list-style', plugins_url( '/css/page-list.css', __FILE__ ), false, '1.7', 'all' );
21
  }
22
 
23
  if ( !function_exists('pagelist_shortcode') ) {
77
  $list_pages = wp_list_pages( $page_list_args );
78
 
79
  if ($list_pages) {
80
+ $return = "\n".'<!-- powered by Page-list plugin ver.1.7 (wordpress.org/extend/plugins/page-list/) -->'."\n";
81
  $return .= '<ul class="page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
82
  }else{
83
  $return = '';
137
  $list_pages = wp_list_pages( $page_list_args );
138
 
139
  if ($list_pages) {
140
+ $return = "\n".'<!-- powered by Page-list plugin ver.1.7 (wordpress.org/extend/plugins/page-list/) -->'."\n";
141
  $return .= '<ul class="page-list subpages-page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
142
  }else{
143
  $return = '';
201
  $list_pages = wp_list_pages( $page_list_args );
202
 
203
  if ($list_pages) {
204
+ $return = "\n".'<!-- powered by Page-list plugin ver.1.7 (wordpress.org/extend/plugins/page-list/) -->'."\n";
205
  $return .= '<ul class="page-list siblings-page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
206
  }else{
207
  $return = '';
237
  'offset' => 0,
238
  'post_type' => 'page',
239
  'post_status' => 'publish',
240
+ 'class' => '',
241
+ 'strip_tags' => 1
242
  ), $atts ) );
243
 
244
  if( $child_of == 'current' || $child_of == 'this' || $child_of == '0' ){
271
  'offset' => $offset,
272
  'post_type' => $post_type,
273
  'post_status' => $post_status,
274
+ 'class' => $class,
275
+ 'strip_tags' => $strip_tags
276
  );
277
  $list_pages = get_pages( $page_list_image_args );
278
  $list_pages_html = '';
292
  if( $show_content == 1 ){
293
  $content = apply_filters('the_content', $page->post_content);
294
  $content = str_replace(']]>', ']]&gt;', $content);
295
+ $content = page_list_parse_content( $page->post_content, $limit_content, $strip_tags );
296
 
297
  $list_pages_html .= '<div class="page-list-ext-item-content">'.$content.'</div>';
298
  }
300
  $list_pages_html .= '</div>'."\n";
301
  }
302
  if ($list_pages_html) {
303
+ $return = "\n".'<!-- powered by Page-list plugin ver.1.7 (wordpress.org/extend/plugins/page-list/) -->'."\n";
304
  $return .= '<div class="page-list page-list-ext '.$class.'">'."\n".$list_pages_html."\n".'</div>';
305
  }else{
306
  $return = '';
312
 
313
 
314
  if ( !function_exists('page_list_parse_content') ) {
315
+ function page_list_parse_content($content, $limit_content = 250, $strip_tags = 1) {
316
  global $more, $preview;
317
 
318
  $output = '';
321
  $content = explode($matches[0], $content, 2);
322
 
323
  } else {
324
+ if( $strip_tags ){
325
+ $content_stripped = strip_tags($content); // ,'<p>'
326
+ }else{
327
+ $content_stripped = $content;
328
+ }
329
+
330
  if( strlen($content_stripped) > $limit_content ){
331
  $pos = strpos($content_stripped, ' ', $limit_content);
332
  if ($pos !== false) {
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: page, page-list, pagelist, sitemap, subpages, siblings
5
  Author URI: http://web-profile.com.ua/wordpress/
6
  Requires at least: 3.0
7
  Tested up to: 3.3
8
- Stable tag: 1.6
9
 
10
  "Page-list" plugin helps you to show list of pages with [pagelist], [subpages], [siblings] and [pagelist_ext] shortcodes.
11
 
@@ -19,7 +19,7 @@ Shortcode [pagelist_ext] is based on functions;
19
  * show hierarchical tree of pages: `[pagelist]`;
20
  * show hierarchical tree of subpages: `[subpages]`;
21
  * show hierarchical tree of sibling pages: `[siblings]`;
22
- * show list of pages with featured images: `[pagelist_ext]`;
23
 
24
  [Page-list plugin page](http://web-profile.com.ua/wordpress/plugins/page-list/)
25
 
@@ -29,11 +29,11 @@ Shortcode [pagelist_ext] is based on functions;
29
 
30
  = Documentation =
31
 
32
- Shortcodes [pagelist], [subpages], [siblings] are based on [wp_list_pages('title_li=')](http://codex.wordpress.org/Template_Tags/wp_list_pages) function;
33
  You can use aditional parameters: **`[pagelist depth="2" child_of="4" exclude="6,7,8"]`**.
34
  Shortcodes [pagelist], [subpages] and [siblings] accept the same parameters. The only difference is that [subpages] and [siblings] not accept `child_of` parameter, because [subpages] shows subpages to the current page and [siblings] shows subpages to the parent page.
35
 
36
- Shortcode [pagelist_ext] is based on [get_pages()](http://codex.wordpress.org/Function_Reference/get_pages) function;
37
  You can use aditional parameters: **`[pagelist child_of="4" exclude="6,7,8" image_width="50" image_height="50"]`**.
38
  Shortcode [pagelist_ext] accept the same parameters.
39
 
@@ -76,10 +76,13 @@ Shortcode [pagelist_ext] accept the same parameters.
76
  * **post_type** - `[pagelist_ext post_type="page"]`;
77
  * **post_status** - `[pagelist_ext post_status="publish"]`;
78
  * **class** - if you want to specify the CSS class for list of pages you can use this shortcode: `[pagelist_ext class="listclass"]`; by default the class is empty (class="");
79
-
80
 
81
  == Changelog ==
82
 
 
 
 
83
  = 1.6 =
84
  * Improved [pagelist_ext] shortcode: added content to list, added toggle show and limit content parameters;
85
 
5
  Author URI: http://web-profile.com.ua/wordpress/
6
  Requires at least: 3.0
7
  Tested up to: 3.3
8
+ Stable tag: 1.7
9
 
10
  "Page-list" plugin helps you to show list of pages with [pagelist], [subpages], [siblings] and [pagelist_ext] shortcodes.
11
 
19
  * show hierarchical tree of pages: `[pagelist]`;
20
  * show hierarchical tree of subpages: `[subpages]`;
21
  * show hierarchical tree of sibling pages: `[siblings]`;
22
+ * show list of pages with featured image and with excerpt: `[pagelist_ext]`;
23
 
24
  [Page-list plugin page](http://web-profile.com.ua/wordpress/plugins/page-list/)
25
 
29
 
30
  = Documentation =
31
 
32
+ Shortcodes [pagelist], [subpages], [siblings] are based on [wp_list_pages('title_li=')](http://codex.wordpress.org/Template_Tags/wp_list_pages) function and show hierarchical tree of pages;
33
  You can use aditional parameters: **`[pagelist depth="2" child_of="4" exclude="6,7,8"]`**.
34
  Shortcodes [pagelist], [subpages] and [siblings] accept the same parameters. The only difference is that [subpages] and [siblings] not accept `child_of` parameter, because [subpages] shows subpages to the current page and [siblings] shows subpages to the parent page.
35
 
36
+ Shortcode [pagelist_ext] is based on [get_pages()](http://codex.wordpress.org/Function_Reference/get_pages) function and show list of pages with featured image and with excerpt;
37
  You can use aditional parameters: **`[pagelist child_of="4" exclude="6,7,8" image_width="50" image_height="50"]`**.
38
  Shortcode [pagelist_ext] accept the same parameters.
39
 
76
  * **post_type** - `[pagelist_ext post_type="page"]`;
77
  * **post_status** - `[pagelist_ext post_status="publish"]`;
78
  * **class** - if you want to specify the CSS class for list of pages you can use this shortcode: `[pagelist_ext class="listclass"]`; by default the class is empty (class="");
79
+ * **strip_tags** - if you want to output the content with tags use this shortcode: `[pagelist_ext strip_tags="0"]`; by default the strip_tags is enabled (strip_tags="1");
80
 
81
  == Changelog ==
82
 
83
+ = 1.7 =
84
+ * Added strip_tags parameter;
85
+
86
  = 1.6 =
87
  * Improved [pagelist_ext] shortcode: added content to list, added toggle show and limit content parameters;
88