Page-list - Version 1.4

Version Description

  • Added exclude="current" parameter;
Download this release

Release Info

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

Code changes from version 1.3.0 to 1.4

Files changed (2) hide show
  1. page-list.php +16 -6
  2. readme.txt +7 -4
page-list.php CHANGED
@@ -3,16 +3,16 @@
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] and [siblings] shortcodes.
6
- Version: 1.3.0
7
  Author: webvitaly
8
  Author Email: webvitaly(at)gmail.com
9
- Author URI: http://web-profile.com.ua/
10
 
11
  Future features:
 
12
  - exclude_by_alias;
13
  - exclude_front_page;
14
  - exclude_post_page;
15
- - [parents];
16
  */
17
 
18
  if ( !function_exists('pagelist_shortcode') ) {
@@ -44,6 +44,9 @@ if ( !function_exists('pagelist_shortcode') ) {
44
  if( $child_of == 'parent' ){
45
  $child_of = $post->post_parent;
46
  }
 
 
 
47
 
48
  $page_list_args = array(
49
  'depth' => $depth,
@@ -69,7 +72,8 @@ if ( !function_exists('pagelist_shortcode') ) {
69
  $list_pages = wp_list_pages( $page_list_args );
70
 
71
  if ($list_pages) {
72
- $return = '<ul class="page-list '.$class.'">'.$list_pages.'</ul>';
 
73
  }else{
74
  $return = '';
75
  }
@@ -127,7 +131,8 @@ if ( !function_exists('subpages_shortcode') ) {
127
  $list_pages = wp_list_pages( $page_list_args );
128
 
129
  if ($list_pages) {
130
- $return = '<ul class="page-list subpages-page-list '.$class.'">'.$list_pages.'</ul>';
 
131
  }else{
132
  $return = '';
133
  }
@@ -161,6 +166,10 @@ if ( !function_exists('siblings_shortcode') ) {
161
  'class' => ''
162
  ), $atts ) );
163
 
 
 
 
 
164
  $page_list_args = array(
165
  'depth' => $depth,
166
  'child_of' => $post->post_parent,
@@ -185,7 +194,8 @@ if ( !function_exists('siblings_shortcode') ) {
185
  $list_pages = wp_list_pages( $page_list_args );
186
 
187
  if ($list_pages) {
188
- $return = '<ul class="page-list siblings-page-list '.$class.'">'.$list_pages.'</ul>';
 
189
  }else{
190
  $return = '';
191
  }
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] and [siblings] shortcodes.
6
+ Version: 1.4
7
  Author: webvitaly
8
  Author Email: webvitaly(at)gmail.com
9
+ Author URI: http://web-profile.com.ua/wordpress/
10
 
11
  Future features:
12
+ - add support exclude="current,5";
13
  - exclude_by_alias;
14
  - exclude_front_page;
15
  - exclude_post_page;
 
16
  */
17
 
18
  if ( !function_exists('pagelist_shortcode') ) {
44
  if( $child_of == 'parent' ){
45
  $child_of = $post->post_parent;
46
  }
47
+ if( $exclude == 'current' || $exclude == 'this' ){
48
+ $exclude = $post->ID;
49
+ }
50
 
51
  $page_list_args = array(
52
  'depth' => $depth,
72
  $list_pages = wp_list_pages( $page_list_args );
73
 
74
  if ($list_pages) {
75
+ $return = "\n".'<!-- powered by Page-list plugin ver. 1.4 (wordpress.org/extend/plugins/page-list/) -->'."\n";
76
+ $return .= '<ul class="page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
77
  }else{
78
  $return = '';
79
  }
131
  $list_pages = wp_list_pages( $page_list_args );
132
 
133
  if ($list_pages) {
134
+ $return = "\n".'<!-- powered by Page-list plugin ver. 1.4 (wordpress.org/extend/plugins/page-list/) -->'."\n";
135
+ $return .= '<ul class="page-list subpages-page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
136
  }else{
137
  $return = '';
138
  }
166
  'class' => ''
167
  ), $atts ) );
168
 
169
+ if( $exclude == 'current' || $exclude == 'this' ){
170
+ $exclude = $post->ID;
171
+ }
172
+
173
  $page_list_args = array(
174
  'depth' => $depth,
175
  'child_of' => $post->post_parent,
194
  $list_pages = wp_list_pages( $page_list_args );
195
 
196
  if ($list_pages) {
197
+ $return = "\n".'<!-- powered by Page-list plugin ver. 1.4 (wordpress.org/extend/plugins/page-list/) -->'."\n";
198
+ $return .= '<ul class="page-list siblings-page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
199
  }else{
200
  $return = '';
201
  }
readme.txt CHANGED
@@ -4,8 +4,8 @@ Plugin URI: http://web-profile.com.ua/wordpress/plugins/page-list/
4
  Tags: page, page-list, pagelist, sitemap, subpages
5
  Author URI: http://web-profile.com.ua/wordpress/
6
  Requires at least: 3.0
7
- Tested up to: 3.2
8
- Stable tag: 1.3.0
9
 
10
  "Page-list" plugin helps you to show list of pages with [pagelist], [subpages] and [siblings] shortcodes.
11
 
@@ -21,7 +21,7 @@ Plugin is based on [wp_list_pages('title_li=')](http://codex.wordpress.org/Templ
21
 
22
  [Page-list plugin page](http://web-profile.com.ua/wordpress/plugins/page-list/)
23
 
24
- [WordPress stuff](http://web-profile.com.ua/wordpress/)
25
 
26
  == Other Notes ==
27
 
@@ -37,7 +37,7 @@ Shortcodes [pagelist], [subpages] and [siblings] accept the same parameters. The
37
  * 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;
38
  * 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"]`;
39
  * if you want to show sibling pages of the current page you can use this shortcodes: `[siblings]` or `[pagelist child_of="parent"]`;
40
- * 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;
41
  * if you want to exclude the tree of pages from the list you can use this shortcode: `[pagelist exclude_tree="7,10"]` where `exclude_tree` parameter accepts comma-separated list of Page IDs (all this pages and their subpages will be excluded);
42
  * if you want to include certain pages into the list of pages you can use this shortcode: `[pagelist include="6,7,8"]` where `include` parameter accepts comma-separated list of Page IDs;
43
  * if you want to specify the title of the list of pages you can use this shortcode: `[pagelist title_li="<h2>List of pages</h2>"]`; by default there is no title (title_li="");
@@ -53,6 +53,9 @@ Shortcodes [pagelist], [subpages] and [siblings] accept the same parameters. The
53
 
54
  == Changelog ==
55
 
 
 
 
56
  = 1.3.0 =
57
  * Added class to ul elements by default;
58
  * Added "class" option (thanks to Arvind);
4
  Tags: page, page-list, pagelist, sitemap, subpages
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.4
9
 
10
  "Page-list" plugin helps you to show list of pages with [pagelist], [subpages] and [siblings] shortcodes.
11
 
21
 
22
  [Page-list plugin page](http://web-profile.com.ua/wordpress/plugins/page-list/)
23
 
24
+ [CMS WordPress](http://web-profile.com.ua/wordpress/)
25
 
26
  == Other Notes ==
27
 
37
  * 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;
38
  * 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"]`;
39
  * if you want to show sibling pages of the current page you can use this shortcodes: `[siblings]` or `[pagelist child_of="parent"]`;
40
+ * 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"]`;
41
  * if you want to exclude the tree of pages from the list you can use this shortcode: `[pagelist exclude_tree="7,10"]` where `exclude_tree` parameter accepts comma-separated list of Page IDs (all this pages and their subpages will be excluded);
42
  * if you want to include certain pages into the list of pages you can use this shortcode: `[pagelist include="6,7,8"]` where `include` parameter accepts comma-separated list of Page IDs;
43
  * if you want to specify the title of the list of pages you can use this shortcode: `[pagelist title_li="<h2>List of pages</h2>"]`; by default there is no title (title_li="");
53
 
54
  == Changelog ==
55
 
56
+ = 1.4 =
57
+ * Added exclude="current" parameter;
58
+
59
  = 1.3.0 =
60
  * Added class to ul elements by default;
61
  * Added "class" option (thanks to Arvind);