Page-list - Version 4.1

Version Description

  • 2013.01.27 =
  • change the type of output the image thumbnail in [pagelist_ext] shortcode
Download this release

Release Info

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

Code changes from version 4.0 to 4.1

Files changed (3) hide show
  1. css/page-list.css +3 -0
  2. page-list.php +13 -8
  3. readme.txt +16 -11
css/page-list.css CHANGED
@@ -9,6 +9,9 @@ http://wordpress.org/extend/plugins/page-list/
9
  }
10
 
11
  /* default styles for [pagelist_ext] */
 
 
 
12
  .page-list-ext .page-list-ext-item {
13
  clear: both;
14
  margin: 10px 0 20px 0;
9
  }
10
 
11
  /* default styles for [pagelist_ext] */
12
+ .page-list-ext {
13
+ clear: both;
14
+ }
15
  .page-list-ext .page-list-ext-item {
16
  clear: both;
17
  margin: 10px 0 20px 0;
page-list.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Page-list
4
  Plugin URI: http://wordpress.org/extend/plugins/page-list/
5
  Description: [pagelist], [subpages], [siblings] and [pagelist_ext] shortcodes
6
- Version: 4.0
7
  Author: webvitaly
8
  Author URI: http://profiles.wordpress.org/webvitaly/
9
  License: GPLv2 or later
@@ -11,13 +11,13 @@ License: GPLv2 or later
11
 
12
  if ( !function_exists('pagelist_unqprfx_add_stylesheet') ) {
13
  function pagelist_unqprfx_add_stylesheet() {
14
- wp_enqueue_style( 'page-list-style', plugins_url( '/css/page-list.css', __FILE__ ), false, '4.0', 'all' );
15
  }
16
  add_action('wp_print_styles', 'pagelist_unqprfx_add_stylesheet');
17
  }
18
 
19
 
20
- $pagelist_unqprfx_powered_line = "\n".'<!-- Page-list plugin v.4.0 wordpress.org/extend/plugins/page-list/ -->'."\n";
21
 
22
 
23
  if ( !function_exists('pagelist_unqprfx_shortcode') ) {
@@ -327,22 +327,27 @@ if ( !function_exists('pagelist_unqprfx_ext_shortcode') ) {
327
  $link = get_permalink( $page->ID );
328
  $list_pages_html .= '<div class="page-list-ext-item">';
329
  if( $show_image == 1 ){
330
- if (function_exists('get_the_post_thumbnail')) {
331
- if( get_the_post_thumbnail($page->ID) ){
332
  $list_pages_html .= '<div class="page-list-ext-image"><a href="'.$link.'" title="'.esc_attr($page->post_title).'">';
333
- $list_pages_html .= get_the_post_thumbnail($page->ID, array($image_width,$image_height));
 
 
 
 
 
334
  $list_pages_html .= '</a></div> ';
335
  }else{
336
  if( $show_first_image == 1 ){
337
  $img_scr = pagelist_unqprfx_get_first_image( $page->post_content );
338
  if( !empty( $img_scr ) ){
339
  $list_pages_html .= '<div class="page-list-ext-image"><a href="'.$link.'" title="'.esc_attr($page->post_title).'">';
340
- $list_pages_html .= '<img src="'.$img_scr.'" width="'.$image_width.'" />'; // not using height="'.$image_height.'" because images could be not square shaped and they will be stretched
341
  $list_pages_html .= '</a></div> ';
342
  }
343
  }
344
  }
345
- }else{
346
  if( $show_first_image == 1 ){
347
  $img_scr = pagelist_unqprfx_get_first_image( $page->post_content );
348
  if( !empty( $img_scr ) ){
3
  Plugin Name: Page-list
4
  Plugin URI: http://wordpress.org/extend/plugins/page-list/
5
  Description: [pagelist], [subpages], [siblings] and [pagelist_ext] shortcodes
6
+ Version: 4.1
7
  Author: webvitaly
8
  Author URI: http://profiles.wordpress.org/webvitaly/
9
  License: GPLv2 or later
11
 
12
  if ( !function_exists('pagelist_unqprfx_add_stylesheet') ) {
13
  function pagelist_unqprfx_add_stylesheet() {
14
+ wp_enqueue_style( 'page-list-style', plugins_url( '/css/page-list.css', __FILE__ ), false, '4.1', 'all' );
15
  }
16
  add_action('wp_print_styles', 'pagelist_unqprfx_add_stylesheet');
17
  }
18
 
19
 
20
+ $pagelist_unqprfx_powered_line = "\n".'<!-- Page-list plugin v.4.1 wordpress.org/extend/plugins/page-list/ -->'."\n";
21
 
22
 
23
  if ( !function_exists('pagelist_unqprfx_shortcode') ) {
327
  $link = get_permalink( $page->ID );
328
  $list_pages_html .= '<div class="page-list-ext-item">';
329
  if( $show_image == 1 ){
330
+ if ( function_exists( 'get_the_post_thumbnail' ) ) { // if we have WordPress 2.9+
331
+ if( get_the_post_thumbnail( $page->ID ) ){ // if there is a featured image
332
  $list_pages_html .= '<div class="page-list-ext-image"><a href="'.$link.'" title="'.esc_attr($page->post_title).'">';
333
+ //$list_pages_html .= get_the_post_thumbnail($page->ID, array($image_width,$image_height)); // doesn't work good with image size
334
+
335
+ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), array($image_width,$image_height) ); // get featured img; 'large'
336
+ $img_url = $image[0]; // get the src of the featured image
337
+ $list_pages_html .= '<img src="'.$img_url.'" width="'.$image_width.'" alt="'.esc_attr($page->post_title).'" />'; // not using height="'.$image_height.'" because images could be not square shaped and they will be stretched
338
+
339
  $list_pages_html .= '</a></div> ';
340
  }else{
341
  if( $show_first_image == 1 ){
342
  $img_scr = pagelist_unqprfx_get_first_image( $page->post_content );
343
  if( !empty( $img_scr ) ){
344
  $list_pages_html .= '<div class="page-list-ext-image"><a href="'.$link.'" title="'.esc_attr($page->post_title).'">';
345
+ $list_pages_html .= '<img src="'.$img_scr.'" width="'.$image_width.'" alt="'.esc_attr($page->post_title).'" />'; // not using height="'.$image_height.'" because images could be not square shaped and they will be stretched
346
  $list_pages_html .= '</a></div> ';
347
  }
348
  }
349
  }
350
+ }else{ // if we have old WordPress 2.8 or lower
351
  if( $show_first_image == 1 ){
352
  $img_scr = pagelist_unqprfx_get_first_image( $page->post_content );
353
  if( !empty( $img_scr ) ){
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: webvitaly
3
  Donate link: http://web-profile.com.ua/donate/
4
  Tags: page, page-list, pagelist, sitemap, subpages, siblings
5
  Requires at least: 3.0
6
- Tested up to: 3.5
7
- Stable tag: 4.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,6 +12,10 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
  == Description ==
14
 
 
 
 
 
15
  = shortcodes: =
16
 
17
  * **[pagelist]** - hierarchical tree of all pages on site (useful to show sitemap of the site);
@@ -19,17 +23,15 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
19
  * **[siblings]** - hierarchical tree of sibling pages to the current page;
20
  * **[pagelist_ext]** - list of pages with featured image and with excerpt;
21
 
22
- = aditional parameters examples: =
23
 
24
- * `[pagelist depth="2" child_of="4" exclude="6,7,8"]`
25
  * `[pagelist_ext child_of="4" exclude="6,7,8" image_width="50" image_height="50"]`
26
  * **[all Page-list params](http://wordpress.org/extend/plugins/page-list/other_notes/)**
27
 
28
- **[Page-list support page](http://web-profile.com.ua/wordpress/plugins/page-list/)**
29
-
30
  = Useful plugins: =
31
- * ["Iframe" - embed iframe with shortcode](http://wordpress.org/extend/plugins/iframe/ "embed iframe")
32
  * ["Anti-spam" - block spam in comments](http://wordpress.org/extend/plugins/anti-spam/ "no spam, no captcha")
 
33
  * ["Filenames to latin" - sanitize filenames to latin during upload](http://wordpress.org/extend/plugins/filenames-to-latin/ "sanitize filenames to latin")
34
 
35
  == Other Notes ==
@@ -100,7 +102,7 @@ Shortcode [pagelist_ext] is based on [get_pages()](http://codex.wordpress.org/Fu
100
 
101
  = What is the difference between [pagelist], [subpages] and [siblings]? =
102
 
103
- 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.
104
 
105
  = How to create sitemap.xml? =
106
  To create sitemap.xml you can use [Google XML Sitemaps](http://wordpress.org/extend/plugins/google-sitemap-generator/) plugin.
@@ -112,7 +114,7 @@ No, there is no "more-link" feature in the plugin. Because "[more-link](http://w
112
  * **bad for usability.** There is already link on title and "more-link" is an extra no needed element on page. If user cannot understand that the title is the link, than there is a problem in css styles and not in plugin's templates.
113
 
114
  = What to do if you need to change the plugin's code? =
115
- When you changed the plugin's code you should also change the plugin's version to '100' to avoid updates, which could override and delete your code.
116
 
117
  == Screenshots ==
118
 
@@ -121,6 +123,9 @@ When you changed the plugin's code you should also change the plugin's version t
121
 
122
  == Changelog ==
123
 
 
 
 
124
  = 4.0 - 2012.10.30 =
125
  * remove conflict between Pagelist and Sitemap plugins
126
  * remove preg_match_all notice
@@ -217,5 +222,5 @@ When you changed the plugin's code you should also change the plugin's version t
217
 
218
  == Installation ==
219
 
220
- 1. Install and activate the plugin on the Plugins page
221
- 2. Add shortcodes to pages: `[pagelist]`, `[subpages]`, `[siblings]`, `[pagelist_ext]`
3
  Donate link: http://web-profile.com.ua/donate/
4
  Tags: page, page-list, pagelist, sitemap, subpages, siblings
5
  Requires at least: 3.0
6
+ Tested up to: 3.5.1
7
+ Stable tag: 4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ **[Page-list](http://web-profile.com.ua/wordpress/plugins/page-list/ "Plugin page")** |
16
+ **[all Page-list params](http://wordpress.org/extend/plugins/page-list/other_notes/)** |
17
+ **[Donate](http://web-profile.com.ua/donate/ "Support the development")**
18
+
19
  = shortcodes: =
20
 
21
  * **[pagelist]** - hierarchical tree of all pages on site (useful to show sitemap of the site);
23
  * **[siblings]** - hierarchical tree of sibling pages to the current page;
24
  * **[pagelist_ext]** - list of pages with featured image and with excerpt;
25
 
26
+ = examples with aditional parameters: =
27
 
28
+ * `[pagelist child_of="4" depth="2" exclude="6,7,8"]`
29
  * `[pagelist_ext child_of="4" exclude="6,7,8" image_width="50" image_height="50"]`
30
  * **[all Page-list params](http://wordpress.org/extend/plugins/page-list/other_notes/)**
31
 
 
 
32
  = Useful plugins: =
 
33
  * ["Anti-spam" - block spam in comments](http://wordpress.org/extend/plugins/anti-spam/ "no spam, no captcha")
34
+ * ["Iframe" - embed iframe with shortcode](http://wordpress.org/extend/plugins/iframe/ "embed iframe")
35
  * ["Filenames to latin" - sanitize filenames to latin during upload](http://wordpress.org/extend/plugins/filenames-to-latin/ "sanitize filenames to latin")
36
 
37
  == Other Notes ==
102
 
103
  = What is the difference between [pagelist], [subpages] and [siblings]? =
104
 
105
+ 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.
106
 
107
  = How to create sitemap.xml? =
108
  To create sitemap.xml you can use [Google XML Sitemaps](http://wordpress.org/extend/plugins/google-sitemap-generator/) plugin.
114
  * **bad for usability.** There is already link on title and "more-link" is an extra no needed element on page. If user cannot understand that the title is the link, than there is a problem in css styles and not in plugin's templates.
115
 
116
  = What to do if you need to change the plugin's code? =
117
+ When you changed the plugin's code you should also change the plugin's version to '100' (for example) to avoid updates, which could override and delete your code.
118
 
119
  == Screenshots ==
120
 
123
 
124
  == Changelog ==
125
 
126
+ = 4.1 - 2013.01.27 =
127
+ * change the type of output the image thumbnail in [pagelist_ext] shortcode
128
+
129
  = 4.0 - 2012.10.30 =
130
  * remove conflict between Pagelist and Sitemap plugins
131
  * remove preg_match_all notice
222
 
223
  == Installation ==
224
 
225
+ 1. install and activate the plugin on the Plugins page
226
+ 2. add shortcodes to pages: `[pagelist]`, `[subpages]`, `[siblings]`, `[pagelist_ext]`