WordPress.org

Plugin Directory

Changeset 1567318


Ignore:
Timestamp:
01/03/17 18:19:54 (6 months ago)
Author:
fernandobt
Message:

Version 0.71

Location:
list-category-posts
Files:
3 edited
8 copied

Legend:

Unmodified
Added
Removed
  • list-category-posts/tags/0.71/include/lcp-catlistdisplayer.php

    r1494938 r1567318  
    236236  private function lcp_build_post($single, $tag){ 
    237237    $class =''; 
     238    $tag_css = ''; 
    238239    if ( is_object($this->parent) && is_object($single) && $this->parent->ID == $single->ID ){ 
    239       $class = ' class="current" '; 
    240     } 
    241     $lcp_display_output = '<'. $tag . $class . '>'; 
     240      $class = 'current'; 
     241    } 
     242 
     243    if ( $this->params['tags_as_class'] == 'yes' ) { 
     244      $post_tags = wp_get_post_Tags($single->ID); 
     245      if ( !empty($post_tags) ){ 
     246        foreach ($post_tags as $post_tag) { 
     247          $class .= " $post_tag->slug "; 
     248        } 
     249      } 
     250    } 
     251    if ( !empty($class) ){ 
     252      $tag_css = 'class="' . $class . '"'; 
     253    } 
     254    $lcp_display_output = '<'. $tag . ' ' . $tag_css . '>'; 
    242255 
    243256    if ( empty($this->params['no_post_titles']) || !empty($this->params['no_post_titles']) && $this->params['no_post_titles'] !== 'yes' ) { 
  • list-category-posts/tags/0.71/list-category-posts.php

    r1494938 r1567318  
    44  Plugin URI: https://github.com/picandocodigo/List-Category-Posts 
    55  Description: List Category Posts allows you to list posts by category in a post/page using the [catlist] shortcode. This shortcode accepts a category name or id, the order in which you want the posts to display, the number of posts to display and many more parameters. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2]. 
    6   Version: 0.70 
     6  Version: 0.71 
    77  Author: Fernando Briano 
    88  Author URI: http://fernandobriano.com 
     
    141141                             'before_month' => '', 
    142142                             'before_day' => '', 
     143                             'tags_as_class' => 'no', 
    143144                           ), $atts); 
    144145    if($atts['numberposts'] == ''){ 
  • list-category-posts/tags/0.71/readme.txt

    r1564547 r1567318  
    55Requires at least: 3.3 
    66Tested up to: 4.7 
    7 Stable tag: 0.70 
     7Stable tag: 0.71 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    307307* **class** - CSS class for the default UL generated by the plugin. 
    308308 
     309* **tags_as_class** - Use a post's tags as a class for the `li` that lists the posts. Default is `no`. For example, `[catlist tags_as_class=yes]` will show a post that has the `fun` tag like this: 
     310``` 
     311<li class=" fun "> 
     312  <a href="http://localhost:8080/?p=1267" title="Post Title">Post Title</a> 
     313</li> 
     314``` 
     315 
    309316* **customfield_display** - Display custom field(s). You can specify 
    310317    many fields to show, separating them with a coma. If you want to 
     
    452459== Changelog == 
    453460 
     461= 0.71 = 
     462 
     463* Added tags_as_class: Use a post's tags as a class for the li that lists the posts. Default is no. Thanks @vacuus on GitHub for this PR! 
     464 
    454465= 0.70 = 
    455466 
  • list-category-posts/trunk/include/lcp-catlistdisplayer.php

    r1494938 r1567318  
    236236  private function lcp_build_post($single, $tag){ 
    237237    $class =''; 
     238    $tag_css = ''; 
    238239    if ( is_object($this->parent) && is_object($single) && $this->parent->ID == $single->ID ){ 
    239       $class = ' class="current" '; 
    240     } 
    241     $lcp_display_output = '<'. $tag . $class . '>'; 
     240      $class = 'current'; 
     241    } 
     242 
     243    if ( $this->params['tags_as_class'] == 'yes' ) { 
     244      $post_tags = wp_get_post_Tags($single->ID); 
     245      if ( !empty($post_tags) ){ 
     246        foreach ($post_tags as $post_tag) { 
     247          $class .= " $post_tag->slug "; 
     248        } 
     249      } 
     250    } 
     251    if ( !empty($class) ){ 
     252      $tag_css = 'class="' . $class . '"'; 
     253    } 
     254    $lcp_display_output = '<'. $tag . ' ' . $tag_css . '>'; 
    242255 
    243256    if ( empty($this->params['no_post_titles']) || !empty($this->params['no_post_titles']) && $this->params['no_post_titles'] !== 'yes' ) { 
  • list-category-posts/trunk/list-category-posts.php

    r1494938 r1567318  
    44  Plugin URI: https://github.com/picandocodigo/List-Category-Posts 
    55  Description: List Category Posts allows you to list posts by category in a post/page using the [catlist] shortcode. This shortcode accepts a category name or id, the order in which you want the posts to display, the number of posts to display and many more parameters. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2]. 
    6   Version: 0.70 
     6  Version: 0.71 
    77  Author: Fernando Briano 
    88  Author URI: http://fernandobriano.com 
     
    141141                             'before_month' => '', 
    142142                             'before_day' => '', 
     143                             'tags_as_class' => 'no', 
    143144                           ), $atts); 
    144145    if($atts['numberposts'] == ''){ 
  • list-category-posts/trunk/readme.txt

    r1564547 r1567318  
    55Requires at least: 3.3 
    66Tested up to: 4.7 
    7 Stable tag: 0.70 
     7Stable tag: 0.71 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    307307* **class** - CSS class for the default UL generated by the plugin. 
    308308 
     309* **tags_as_class** - Use a post's tags as a class for the `li` that lists the posts. Default is `no`. For example, `[catlist tags_as_class=yes]` will show a post that has the `fun` tag like this: 
     310``` 
     311<li class=" fun "> 
     312  <a href="http://localhost:8080/?p=1267" title="Post Title">Post Title</a> 
     313</li> 
     314``` 
     315 
    309316* **customfield_display** - Display custom field(s). You can specify 
    310317    many fields to show, separating them with a coma. If you want to 
     
    452459== Changelog == 
    453460 
     461= 0.71 = 
     462 
     463* Added tags_as_class: Use a post's tags as a class for the li that lists the posts. Default is no. Thanks @vacuus on GitHub for this PR! 
     464 
    454465= 0.70 = 
    455466 
Note: See TracChangeset for help on using the changeset viewer.