Page-list - Version 1.0.0

Version Description

  • Initial release;

=

Download this release

Release Info

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

Version 1.0.0

Files changed (2) hide show
  1. page-list.php +48 -0
  2. readme.txt +36 -0
page-list.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Page-list
4
+ Plugin URI: http://web-profile.com.ua/wordpress/plugins/page-list/
5
+ Description: Show pagelist with [pagelist] shortcode.
6
+ Version: 1.0.0
7
+ Author: webvitaly
8
+ Author Email: webvitaly(at)gmail.com
9
+ Author URI: http://web-profile.com.ua/
10
+ */
11
+
12
+ function pagelist_shortcode( $atts ) {
13
+ extract( shortcode_atts( array(
14
+ 'depth' => '0',
15
+ 'child_of' => '0',
16
+ 'exclude' => '0'
17
+ ), $atts ) );
18
+ global $post;
19
+ $return = '';
20
+ if( $child_of == 'current' || $child_of == 'this' ){
21
+ $child_of = $post->ID;
22
+ }
23
+ $list_pages_args = array(
24
+ 'depth' => $depth,
25
+ 'show_date' => '',
26
+ 'date_format' => get_option('date_format'),
27
+ 'child_of' => $child_of,
28
+ 'exclude' => $exclude,
29
+ 'include' => '',
30
+ 'title_li' => '',
31
+ 'echo' => 0,
32
+ 'authors' => '',
33
+ 'sort_column' => 'menu_order, post_title',
34
+ 'link_before' => '',
35
+ 'link_after' => '',
36
+ 'walker' => '' );
37
+
38
+ $list_pages = wp_list_pages( $list_pages_args );
39
+
40
+ if ($list_pages) {
41
+ $return = '<ul>'.$list_pages.'</ul>';
42
+ }else{
43
+ $return = '';
44
+ }
45
+
46
+ return $return;
47
+ }
48
+ add_shortcode( 'pagelist', 'pagelist_shortcode' );
readme.txt ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Page-list ===
2
+ Contributors: webvitaly
3
+ Donate link: http://web-profile.com.ua/wordpress/plugins/page-list/
4
+ Plugin URI: http://web-profile.com.ua/wordpress/plugins/page-list/
5
+ Tags: page, page-list, pagelist
6
+ Author URI: http://web-profile.com.ua/wordpress/
7
+ Requires at least: 3.0
8
+ Tested up to: 3.1.1
9
+ Stable tag: 1.0.0
10
+
11
+ "Page-list" plugin helps you to show list of pages of your web-site (hierarchical tree of pages) with [pagelist] shortcode.
12
+
13
+ == Description ==
14
+
15
+ You can use aditional parameters: **`[pagelist depth="2" child_of="4" exclude="6,7,8"]`**.
16
+
17
+ Plugin is based on [wp_list_pages('title_li=')](http://codex.wordpress.org/Template_Tags/wp_list_pages) function;
18
+ = Usage: =
19
+ * the depth (how many levels in the hierarchy of pages are to be included in the list) by default is unlimited, but you can specify it like this: `[pagelist depth="3"]`;
20
+ * if you want to show flat list of pages (not hierarchical tree) you can use this shortcode: `[pagelist depth="-1"]`;
21
+ * 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;
22
+ * if you want to show subpages of the current page you can use this shortcode: `[pagelist child_of="current"]` or `[pagelist child_of="this"]`;
23
+ * 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;
24
+
25
+ [WordPress stuff](http://web-profile.com.ua/wordpress/)
26
+
27
+ == Changelog ==
28
+
29
+ = 1.0.0 =
30
+ * Initial release;
31
+
32
+ == Installation ==
33
+
34
+ 1. Install plugin and activate it on the Plugins page;
35
+ 2. Add shortcode **`[pagelist]`** to page content;
36
+