Plugin Directory

Changeset 474151


Ignore:
Timestamp:
12/12/2011 07:15:41 PM (14 years ago)
Author:
mattrude
Message:

Add 'Show Home Page?' support to plugin, see #1

Location:
top-posts-pages-widget/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • top-posts-pages-widget/trunk/readme.txt

    r474079 r474151  
    3939== Changelog ==
    4040
     41= 0.4 =
     42
     43* Add 'Show Home Page?' support to plugin
     44
    4145= 0.3 =
    4246
  • top-posts-pages-widget/trunk/top_posts_n_pages.php

    r473732 r474151  
    3131    $tpp_show_pages = $instance['show_pages'];
    3232    $tpp_show_attachments = $instance['show_attachments'];
     33    $tpp_show_home = $instance['show_home'];
    3334
    3435    if ($tpp_widget_title == "") {
     
    4243    if ($tpp_show_attachments == "") {
    4344      $tpp_show_attachments = "off";
     45    }
     46
     47    if ($tpp_show_home == "") {
     48      $tpp_show_home = "off";
    4449    }
    4550
     
    6772          if ( $tpp_show_attachments == "off" ) {
    6873            if( $top_post_id->post_type == "attachment" ) continue;
     74          }
     75 
     76          if ( $tpp_show_home == "off" ) {
     77            if( $top_post['post_title'] == "Home page" ) continue;
    6978          } ?>
    7079
     
    8796    $instance['show_pages'] = strip_tags(empty($new_instance['show_pages']) ? 'on' : apply_filters('show_pages', $new_instance['show_pages']));
    8897    $instance['show_attachments'] = strip_tags(empty($new_instance['show_attachments']) ? 'off' : apply_filters('show_attachments', $new_instance['show_attachments']));
     98    $instance['show_home'] = strip_tags(empty($new_instance['show_home']) ? 'off' : apply_filters('show_home', $new_instance['show_home']));
    8999    return $instance;
    90100  }
     
    95105    $tpp_show_pages = $instance['show_pages'];
    96106    $tpp_show_attachments = $instance['show_attachments'];
     107    $tpp_show_home = $instance['show_home'];
    97108
    98109    if ($tpp_widget_title == "") {
     
    106117    if ($tpp_show_attachments == "") {
    107118      $tpp_show_attachments = "off";
     119    }
     120
     121    if ($tpp_show_home == "") {
     122      $tpp_show_home = "off";
    108123    }
    109124
     
    126141    <label for="<?php echo $this->get_field_id('show_attachments'); ?>"><?php _e('Show attachments?', 'top-posts-n-pages-widget')?></label></p>
    127142   
     143    <p><input class="checkbox" type="checkbox" <?php if ("$tpp_show_home" == "on" ){echo 'checked="checked"';} ?> id="<?php echo $this->get_field_id('show_home'); ?>" name="<?php echo $this->get_field_name('show_home'); ?>" />
     144    <label for="<?php echo $this->get_field_id('show_home'); ?>"><?php _e('Show Home Page?', 'top-posts-n-pages-widget')?></label></p>
     145   
    128146    <p><?php _e( 'Top Posts &amp; Pages are calculated from WordPress.com stats plugin for that last 7 days. So, they take a while to change.', 'top-posts-n-pages-widget'); ?></p><?php
    129147
Note: See TracChangeset for help on using the changeset viewer.