Page-list - Version 3.8

Version Description

  • fixed default [pagelist_ext] behaviour - showing all pages if there is no subpages
Download this release

Release Info

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

Code changes from version 3.7 to 3.8

Files changed (3) hide show
  1. css/page-list.css +18 -3
  2. page-list.php +40 -5
  3. readme.txt +14 -7
css/page-list.css CHANGED
@@ -1,5 +1,20 @@
1
  /* Page-list plugin styles (wordpress.org/extend/plugins/page-list/) */
2
 
3
- .page-list-ext .page-list-ext-item {clear:both; margin:10px 0 20px 0;}
4
- .page-list-ext .page-list-ext-image {float:left; display:inline; margin:5px 10px 10px 0;}
5
- .page-list-ext .page-list-ext-title {clear:none;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /* Page-list plugin styles (wordpress.org/extend/plugins/page-list/) */
2
 
3
+ /* default styles for [pagelist_ext] */
4
+ .page-list-ext .page-list-ext-item {
5
+ clear: both;
6
+ margin: 10px 0 20px 0;
7
+ }
8
+ .page-list-ext .page-list-ext-image {
9
+ float: left;
10
+ display: inline;
11
+ margin: 5px 10px 10px 0;
12
+ }
13
+ .page-list-ext .page-list-ext-title {
14
+ clear: none;
15
+ }
16
+
17
+ /* default styles for [pagelist], [subpages], [siblings] */
18
+ .page-list .current_page_item a {
19
+ font-weight: bold; /* hilite active item */
20
+ }
page-list.php CHANGED
@@ -1,20 +1,20 @@
1
  <?php
2
  /*
3
- Plugin Name: [pagelist]
4
  Plugin URI: http://web-profile.com.ua/wordpress/plugins/page-list/
5
  Description: [pagelist], [subpages], [siblings] and [pagelist_ext] shortcodes
6
- Version: 3.7
7
  Author: webvitaly
8
- Author Email: webvitaly(at)gmail.com
9
  Author URI: http://web-profile.com.ua/wordpress/
10
  */
11
 
12
  add_action('wp_print_styles', 'pagelist_add_stylesheet');
13
  function pagelist_add_stylesheet() {
14
- wp_enqueue_style( 'page-list-style', plugins_url( '/css/page-list.css', __FILE__ ), false, '3.7', 'all' );
15
  }
16
 
17
- $pagelist_powered_line = "\n".'<!-- Page-list plugin v.3.7 (wordpress.org/extend/plugins/page-list/) -->'."\n";
18
 
19
  if ( !function_exists('pagelist_shortcode') ) {
20
  function pagelist_shortcode( $atts ) {
@@ -270,7 +270,42 @@ if ( !function_exists('pagelist_ext_shortcode') ) {
270
  'show_meta_key' => $show_meta_key,
271
  'meta_template' => $meta_template
272
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  $list_pages = get_pages( $page_list_ext_args );
 
 
 
274
  $list_pages_html = '';
275
  $count = 0;
276
  $offset_count = 0;
1
  <?php
2
  /*
3
+ Plugin Name: Page-list
4
  Plugin URI: http://web-profile.com.ua/wordpress/plugins/page-list/
5
  Description: [pagelist], [subpages], [siblings] and [pagelist_ext] shortcodes
6
+ Version: 3.8
7
  Author: webvitaly
8
+ Author Email: vitalymylo(at)gmail.com
9
  Author URI: http://web-profile.com.ua/wordpress/
10
  */
11
 
12
  add_action('wp_print_styles', 'pagelist_add_stylesheet');
13
  function pagelist_add_stylesheet() {
14
+ wp_enqueue_style( 'page-list-style', plugins_url( '/css/page-list.css', __FILE__ ), false, '3.8', 'all' );
15
  }
16
 
17
+ $pagelist_powered_line = "\n".'<!-- Page-list plugin v.3.8 wordpress.org/extend/plugins/page-list/ -->'."\n";
18
 
19
  if ( !function_exists('pagelist_shortcode') ) {
20
  function pagelist_shortcode( $atts ) {
270
  'show_meta_key' => $show_meta_key,
271
  'meta_template' => $meta_template
272
  );
273
+ $page_list_ext_args_all = array(
274
+ 'show_image' => $show_image,
275
+ 'show_first_image' => $show_first_image,
276
+ 'show_title' => $show_title,
277
+ 'show_content' => $show_content,
278
+ 'more_tag' => $more_tag,
279
+ 'limit_content' => $limit_content,
280
+ 'image_width' => $image_width,
281
+ 'image_height' => $image_height,
282
+ 'child_of' => 0, // for showing all pages
283
+ 'sort_order' => $sort_order,
284
+ 'sort_column' => $sort_column,
285
+ 'hierarchical' => $hierarchical,
286
+ 'exclude' => pagelist_norm_params($exclude),
287
+ 'include' => $include,
288
+ 'meta_key' => $meta_key,
289
+ 'meta_value' => $meta_value,
290
+ 'authors' => $authors,
291
+ 'parent' => pagelist_norm_params($parent),
292
+ 'exclude_tree' => $exclude_tree,
293
+ 'number' => '', // $number - own counter
294
+ 'offset' => 0, // $offset - own offset
295
+ 'post_type' => $post_type,
296
+ 'post_status' => $post_status,
297
+ 'class' => $class,
298
+ 'strip_tags' => $strip_tags,
299
+ 'strip_shortcodes' => $strip_shortcodes,
300
+ 'show_child_count' => $show_child_count,
301
+ 'child_count_template' => $child_count_template,
302
+ 'show_meta_key' => $show_meta_key,
303
+ 'meta_template' => $meta_template
304
+ );
305
  $list_pages = get_pages( $page_list_ext_args );
306
+ if( count( $list_pages ) == 0 ){ // if there is no subpages
307
+ $list_pages = get_pages( $page_list_ext_args_all ); // we are showing all pages
308
+ }
309
  $list_pages_html = '';
310
  $count = 0;
311
  $offset_count = 0;
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
- === [pagelist] ===
2
  Contributors: webvitaly
3
  Plugin URI: http://web-profile.com.ua/wordpress/plugins/page-list/
4
  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.1
8
- Stable tag: 3.7
9
 
10
  [pagelist], [subpages], [siblings] and [pagelist_ext] shortcodes
11
 
@@ -26,14 +26,17 @@ Stable tag: 3.7
26
 
27
  [Page-list plugin page](http://web-profile.com.ua/wordpress/plugins/page-list/)
28
 
29
- = Try other useful plugins: =
30
- * [Iframe](http://wordpress.org/extend/plugins/iframe/) - embed iframe with shortcode
31
- * [Login Logout](http://wordpress.org/extend/plugins/login-logout/) - default Meta widget replacement
32
- * [Filenames to latin](http://wordpress.org/extend/plugins/filenames-to-latin/) - sanitize filenames to latin during upload
33
 
34
  == Other Notes ==
35
 
36
  = Parameters for [pagelist], [subpages] and [siblings]: =
 
 
 
37
  * **depth** - means how many levels in the hierarchy of pages are to be included in the list, by default depth is unlimited (depth=0), but you can specify it like this: `[pagelist depth="3"]`; If you want to show flat list of pages (not hierarchical tree) you can use this shortcode: `[pagelist depth="-1"]`;
38
  * **child_of** - if you want to show subpages of the specific page you can use this shortcode: `[pagelist child_of="4"]` where `4` is the ID of the specific page; If you want to show subpages of the current page you can use this shortcodes: `[subpages]` or `[pagelist child_of="current"]` or `[pagelist child_of="this"]`; If you want to show sibling pages of the current page you can use this shortcodes: `[siblings]` or `[pagelist child_of="parent"]`;
39
  * **exclude** - if you want to exclude some pages from the list you can use this shortcode: `[pagelist exclude="6,7,8"]` where `exclude` parameter accepts comma-separated list of Page IDs; You may exclude current page with this shortcode: `[pagelist exclude="current"]`;
@@ -51,6 +54,7 @@ Stable tag: 3.7
51
  * **class** - if you want to specify the CSS class for list of pages you can use this shortcode: `[pagelist class="listclass"]`; by default the class is empty (class="");
52
 
53
  = Parameters for [pagelist_ext]: =
 
54
  * **show_image** - show or hide featured image `[pagelist_ext show_image="0"]`; "show_image" have higher priority than "show_first_image"; by default: show_image="1";
55
  * **show_first_image** - show or hide first image from content if there is no featured image `[pagelist_ext show_first_image="1"]`; by default: show_first_image="0";
56
  * **show_title** - show or hide title `[pagelist_ext show_title="0"]`; by default: show_title="1";
@@ -116,6 +120,9 @@ But if you still need "more-link" feature and you will add it by yourself, than
116
 
117
  == Changelog ==
118
 
 
 
 
119
  = 3.7 =
120
  * executing shortcodes in [pagelist_ext strip_shortcodes="0"] in content
121
 
1
+ === Page-list ===
2
  Contributors: webvitaly
3
  Plugin URI: http://web-profile.com.ua/wordpress/plugins/page-list/
4
  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.4.1
8
+ Stable tag: 3.8
9
 
10
  [pagelist], [subpages], [siblings] and [pagelist_ext] shortcodes
11
 
26
 
27
  [Page-list plugin page](http://web-profile.com.ua/wordpress/plugins/page-list/)
28
 
29
+ = useful plugins: =
30
+ * ["Iframe" - embed iframe with shortcode](http://wordpress.org/extend/plugins/iframe/)
31
+ * ["Login Logout" - default Meta widget replacement](http://wordpress.org/extend/plugins/login-logout/) - default Meta widget replacement
32
+ * ["Filenames to latin" - sanitize filenames to latin during upload](http://wordpress.org/extend/plugins/filenames-to-latin/)
33
 
34
  == Other Notes ==
35
 
36
  = Parameters for [pagelist], [subpages] and [siblings]: =
37
+ * **[pagelist]** - by default shows list of all pages as the hierarchical list;
38
+ * **[subpages]** - by default shows list of subpages to the current page as the hierarchical list;
39
+ * **[siblings]** - by default shows list of sibling pages to the current page as the hierarchical list;
40
  * **depth** - means how many levels in the hierarchy of pages are to be included in the list, by default depth is unlimited (depth=0), but you can specify it like this: `[pagelist depth="3"]`; If you want to show flat list of pages (not hierarchical tree) you can use this shortcode: `[pagelist depth="-1"]`;
41
  * **child_of** - if you want to show subpages of the specific page you can use this shortcode: `[pagelist child_of="4"]` where `4` is the ID of the specific page; If you want to show subpages of the current page you can use this shortcodes: `[subpages]` or `[pagelist child_of="current"]` or `[pagelist child_of="this"]`; If you want to show sibling pages of the current page you can use this shortcodes: `[siblings]` or `[pagelist child_of="parent"]`;
42
  * **exclude** - if you want to exclude some pages from the list you can use this shortcode: `[pagelist exclude="6,7,8"]` where `exclude` parameter accepts comma-separated list of Page IDs; You may exclude current page with this shortcode: `[pagelist exclude="current"]`;
54
  * **class** - if you want to specify the CSS class for list of pages you can use this shortcode: `[pagelist class="listclass"]`; by default the class is empty (class="");
55
 
56
  = Parameters for [pagelist_ext]: =
57
+ * **[pagelist_ext]** - by default shows list of subpages to current page; but if there is no subpages than all pages will be shown;
58
  * **show_image** - show or hide featured image `[pagelist_ext show_image="0"]`; "show_image" have higher priority than "show_first_image"; by default: show_image="1";
59
  * **show_first_image** - show or hide first image from content if there is no featured image `[pagelist_ext show_first_image="1"]`; by default: show_first_image="0";
60
  * **show_title** - show or hide title `[pagelist_ext show_title="0"]`; by default: show_title="1";
120
 
121
  == Changelog ==
122
 
123
+ = 3.8 =
124
+ * fixed default [pagelist_ext] behaviour - showing all pages if there is no subpages
125
+
126
  = 3.7 =
127
  * executing shortcodes in [pagelist_ext strip_shortcodes="0"] in content
128