Changeset 534339
- Timestamp:
- 04/21/2012 03:08:33 AM (14 years ago)
- Location:
- akfeatured-post-widget
- Files:
-
- 2 edited
- 3 copied
-
tags/1.1 (copied) (copied from akfeatured-post-widget/trunk)
-
tags/1.1/ak_featured_post.php (copied) (copied from akfeatured-post-widget/trunk/ak_featured_post.php) (9 diffs)
-
tags/1.1/readme.txt (copied) (copied from akfeatured-post-widget/trunk/readme.txt) (3 diffs)
-
trunk/ak_featured_post.php (modified) (9 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
akfeatured-post-widget/tags/1.1/ak_featured_post.php
r533761 r534339 4 4 Plugin URI: http://cssboss.com/featured_post 5 5 Description: Plugin to display the latest post from a specific category 6 Version: 1. 16 Version: 1.2 7 7 Author: Andrew Kaser 8 8 Author URI: http://www.andrewkaser.com … … 10 10 */ 11 11 12 /* Copyright 2012 ANDREW KASER (email : [email protected]) 13 14 This program is free software; you can redistribute it and/or modify 15 it under the terms of the GNU General Public License, version 2, as 16 published by the Free Software Foundation. 17 18 This program is distributed in the hope that it will be useful, 19 but WITHOUT ANY WARRANTY; without even the implied warranty of 20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 GNU General Public License for more details. 22 23 You should have received a copy of the GNU General Public License 24 along with this program; if not, write to the Free Software 25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 26 */ 27 12 28 class ak_featured_post_widget extends WP_Widget { 13 public function __construct() { 29 public function __construct() 30 { 14 31 parent::__construct( 15 32 'ak_featured_post_widget', // Base ID … … 32 49 } 33 50 34 public function form($instance){ 51 public function form($instance) 52 { 35 53 if (isset($instance['category'])){ $category = $instance[ 'category' ]; } else { $category = __( 'Featured', 'text_domain' ); } 36 54 if (isset($instance['title'])){ $title=$instance['title']; } else { $title=__('Featured Post','text_domain'); } … … 38 56 if (isset($instance['show_post_title'])){ $show_post_title = $instance['show_post_title']; } else { $show_post_title = __('checked','text_domain'); } 39 57 if (isset($instance['show_post_limit'])){ $show_post_limit = $instance['show_post_limit']; } else { $show_post_limit = __('1','text_domain'); } 58 if (isset($instance['show_featured_image'])){ $show_featured_image = $instance['show_featured_image']; } else { $show_featured_image = __('checked','text_domain'); } 59 if (isset($instance['show_support_link'])){ $show_support_link = $instance['show_support_link']; } else { $show_support_link = __('checked','text_domain'); } 40 60 ?> 41 61 <p> … … 46 66 <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> 47 67 <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /> 68 <br /> 48 69 49 70 <label for="<?php echo $this->get_field_id( 'link_title_to_cat' ); ?>"><?php _e( 'Link Title To Category :' ); ?></label> 50 71 <input id="<?php echo $this->get_field_id( 'link_title_to_cat' ); ?>" name="<?php echo $this->get_field_name( 'link_title_to_cat' ); ?>" type="checkbox" value="<?php echo esc_attr( $link_title_to_cat ); ?>" <?php checked( (bool) $link_title_to_cat, true ); ?> /> 51 72 <br /> 73 52 74 <label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Category :' ); ?></label> 53 75 <select id="<?php echo $this->get_field_id( 'catgeory' ); ?>" name="<?php echo $this->get_field_name( 'category' ); ?>" > … … 67 89 </select> 68 90 <br /> 91 69 92 <label for="<?php echo $this->get_field_id( 'show_post_title' ); ?>"><?php _e( 'Show Post Title :' ); ?></label> 70 93 <input id="<?php echo $this->get_field_id( 'show_post_title' ); ?>" name="<?php echo $this->get_field_name( 'show_post_title' ); ?>" type="checkbox" value="<?php echo esc_attr( $show_post_title ); ?>" <?php checked( (bool) $show_post_title, true ); ?> /> 94 <br /> 95 96 <label for="<?php echo $this->get_field_id( 'show_featured_image' ); ?>"><?php _e( 'Show Featured Image :' ); ?></label> 97 <input id="<?php echo $this->get_field_id( 'show_featured_image' ); ?>" name="<?php echo $this->get_field_name( 'show_featured_image' ); ?>" type="checkbox" value="<?php echo esc_attr( $show_featured_image ); ?>" <?php checked( (bool) $show_featured_image, true ); ?> /> 98 <br /> 99 100 <label for="<?php echo $this->get_field_id( 'show_support_link' ); ?>"><?php _e( 'Show Support Link :' ); ?></label> 101 <input id="<?php echo $this->get_field_id( 'show_support_link' ); ?>" name="<?php echo $this->get_field_name( 'show_support_link' ); ?>" type="checkbox" value="<?php echo esc_attr( $show_support_link ); ?>" <?php checked( (bool) $show_support_link, true ); ?> /> 71 102 72 103 </p> … … 82 113 $instance['title'] = strip_tags( $new_instance['title']); 83 114 $instance['show_post_title'] = ( isset( $new_instance['show_post_title'] ) ? 1 : 0 ); 115 $instance['show_featured_image'] = ( isset( $new_instance['show_featured_image'] ) ? 1 : 0 ); 116 $instance['show_support_link'] = ( isset( $new_instance['show_support_link'] ) ? 1 : 0 ); 84 117 return $instance; 85 118 } … … 99 132 $show_post_title = $instance['show_post_title']; 100 133 $show_post_limit = $instance['show_post_limit']; 134 $show_featured_image = $instance['show_featured_image']; 135 $show_support_link = $instance['show_support_link']; 136 101 137 102 138 … … 120 156 if ($show_post_title) { the_title(); } // To show the title of the post, or not... That is the question 121 157 122 if (has_post_thumbnail()) { 123 the_post_thumbnail('medium', array( 124 'class' => 'ak_featured_post_image', 125 'title' => $image_title)); 126 } 158 if ( $show_featured_image ) 159 { 160 if (has_post_thumbnail()) 161 { 162 the_post_thumbnail('medium', array( 163 'class' => 'ak_featured_post_image', 164 'title' => $image_title)); 165 } 166 } 127 167 ?> 128 168 </a> 169 129 170 </li> 130 171 <?php 131 172 endwhile; 132 173 174 if ( $show_support_link ) 175 { ?> 176 Powered By <a href="http://www.cssboss.com/featured_post" target="_blank">AK: Featured Post</a> 177 <?php } 133 178 echo $after_widget; // end widget 134 179 -
akfeatured-post-widget/tags/1.1/readme.txt
r534209 r534339 8 8 Contributors: Kaser\ 9 9 Donate Link: http://www.cssboss.com/donate\ 10 Tags : Featured Posts, Post Widget, Category Posts Widget, display posts\10 Tags: Featured Posts, Post Widget, Category Posts Widget, display posts\ 11 11 Requires at least: 3.3\ 12 Tested up to 3.3\12 Tested up to: 3.3\ 13 13 Stable tag: 1.1\ 14 14 \ 15 A simple widget that you can use to display a number of posts (from 1 to 99) from a specific category into any widgetized area of your blog.\16 Watch This Video : {\field{\*\fldinst{HYPERLINK "http://www.youtube.com/watch?v=eWhafkO7uJQ"}}{\fldrslt http://www.youtube.com/watch?v=eWhafkO7uJQ}}\15 A widget that you can use to display posts from a category \ 16 Watch This Video : http://www.youtube.com/watch?v=eWhafkO7uJQ\ 17 17 \ 18 18 == Description ==\ … … 21 21 \ 22 22 Video is more my style, so check out this video tutorial I made for the plugin \ 23 {\field{\*\fldinst{HYPERLINK "http://www.youtube.com/watch?v=eWhafkO7uJQ"}}{\fldrslt http://www.youtube.com/watch?v=eWhafkO7uJQ}}\23 http://www.youtube.com/watch?v=eWhafkO7uJQ\ 24 24 \ 25 25 * You can create custom titles\ … … 35 35 \ 36 36 To manually upload the plugin :\ 37 1. Download and extract the `ak-featured-post` plugin from {\field{\*\fldinst{HYPERLINK "http://wordpress.org/extend/plugins/akfeatured-post-widget/"}}{\fldrslt http://wordpress.org/extend/plugins/akfeatured-post-widget/}}\37 1. Download and extract the `ak-featured-post` plugin from http://wordpress.org/extend/plugins/akfeatured-post-widget/ \ 38 38 2. Upload `ak-featured-post` plugin folder to your wordpress plugin directory, default is `wp-content/plugins/`\ 39 39 3. Activate the plugin through the 'Plugins' menu inside of the wordpress wp-admin dashboard\ -
akfeatured-post-widget/trunk/ak_featured_post.php
r533761 r534339 4 4 Plugin URI: http://cssboss.com/featured_post 5 5 Description: Plugin to display the latest post from a specific category 6 Version: 1. 16 Version: 1.2 7 7 Author: Andrew Kaser 8 8 Author URI: http://www.andrewkaser.com … … 10 10 */ 11 11 12 /* Copyright 2012 ANDREW KASER (email : [email protected]) 13 14 This program is free software; you can redistribute it and/or modify 15 it under the terms of the GNU General Public License, version 2, as 16 published by the Free Software Foundation. 17 18 This program is distributed in the hope that it will be useful, 19 but WITHOUT ANY WARRANTY; without even the implied warranty of 20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 GNU General Public License for more details. 22 23 You should have received a copy of the GNU General Public License 24 along with this program; if not, write to the Free Software 25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 26 */ 27 12 28 class ak_featured_post_widget extends WP_Widget { 13 public function __construct() { 29 public function __construct() 30 { 14 31 parent::__construct( 15 32 'ak_featured_post_widget', // Base ID … … 32 49 } 33 50 34 public function form($instance){ 51 public function form($instance) 52 { 35 53 if (isset($instance['category'])){ $category = $instance[ 'category' ]; } else { $category = __( 'Featured', 'text_domain' ); } 36 54 if (isset($instance['title'])){ $title=$instance['title']; } else { $title=__('Featured Post','text_domain'); } … … 38 56 if (isset($instance['show_post_title'])){ $show_post_title = $instance['show_post_title']; } else { $show_post_title = __('checked','text_domain'); } 39 57 if (isset($instance['show_post_limit'])){ $show_post_limit = $instance['show_post_limit']; } else { $show_post_limit = __('1','text_domain'); } 58 if (isset($instance['show_featured_image'])){ $show_featured_image = $instance['show_featured_image']; } else { $show_featured_image = __('checked','text_domain'); } 59 if (isset($instance['show_support_link'])){ $show_support_link = $instance['show_support_link']; } else { $show_support_link = __('checked','text_domain'); } 40 60 ?> 41 61 <p> … … 46 66 <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> 47 67 <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /> 68 <br /> 48 69 49 70 <label for="<?php echo $this->get_field_id( 'link_title_to_cat' ); ?>"><?php _e( 'Link Title To Category :' ); ?></label> 50 71 <input id="<?php echo $this->get_field_id( 'link_title_to_cat' ); ?>" name="<?php echo $this->get_field_name( 'link_title_to_cat' ); ?>" type="checkbox" value="<?php echo esc_attr( $link_title_to_cat ); ?>" <?php checked( (bool) $link_title_to_cat, true ); ?> /> 51 72 <br /> 73 52 74 <label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Category :' ); ?></label> 53 75 <select id="<?php echo $this->get_field_id( 'catgeory' ); ?>" name="<?php echo $this->get_field_name( 'category' ); ?>" > … … 67 89 </select> 68 90 <br /> 91 69 92 <label for="<?php echo $this->get_field_id( 'show_post_title' ); ?>"><?php _e( 'Show Post Title :' ); ?></label> 70 93 <input id="<?php echo $this->get_field_id( 'show_post_title' ); ?>" name="<?php echo $this->get_field_name( 'show_post_title' ); ?>" type="checkbox" value="<?php echo esc_attr( $show_post_title ); ?>" <?php checked( (bool) $show_post_title, true ); ?> /> 94 <br /> 95 96 <label for="<?php echo $this->get_field_id( 'show_featured_image' ); ?>"><?php _e( 'Show Featured Image :' ); ?></label> 97 <input id="<?php echo $this->get_field_id( 'show_featured_image' ); ?>" name="<?php echo $this->get_field_name( 'show_featured_image' ); ?>" type="checkbox" value="<?php echo esc_attr( $show_featured_image ); ?>" <?php checked( (bool) $show_featured_image, true ); ?> /> 98 <br /> 99 100 <label for="<?php echo $this->get_field_id( 'show_support_link' ); ?>"><?php _e( 'Show Support Link :' ); ?></label> 101 <input id="<?php echo $this->get_field_id( 'show_support_link' ); ?>" name="<?php echo $this->get_field_name( 'show_support_link' ); ?>" type="checkbox" value="<?php echo esc_attr( $show_support_link ); ?>" <?php checked( (bool) $show_support_link, true ); ?> /> 71 102 72 103 </p> … … 82 113 $instance['title'] = strip_tags( $new_instance['title']); 83 114 $instance['show_post_title'] = ( isset( $new_instance['show_post_title'] ) ? 1 : 0 ); 115 $instance['show_featured_image'] = ( isset( $new_instance['show_featured_image'] ) ? 1 : 0 ); 116 $instance['show_support_link'] = ( isset( $new_instance['show_support_link'] ) ? 1 : 0 ); 84 117 return $instance; 85 118 } … … 99 132 $show_post_title = $instance['show_post_title']; 100 133 $show_post_limit = $instance['show_post_limit']; 134 $show_featured_image = $instance['show_featured_image']; 135 $show_support_link = $instance['show_support_link']; 136 101 137 102 138 … … 120 156 if ($show_post_title) { the_title(); } // To show the title of the post, or not... That is the question 121 157 122 if (has_post_thumbnail()) { 123 the_post_thumbnail('medium', array( 124 'class' => 'ak_featured_post_image', 125 'title' => $image_title)); 126 } 158 if ( $show_featured_image ) 159 { 160 if (has_post_thumbnail()) 161 { 162 the_post_thumbnail('medium', array( 163 'class' => 'ak_featured_post_image', 164 'title' => $image_title)); 165 } 166 } 127 167 ?> 128 168 </a> 169 129 170 </li> 130 171 <?php 131 172 endwhile; 132 173 174 if ( $show_support_link ) 175 { ?> 176 Powered By <a href="http://www.cssboss.com/featured_post" target="_blank">AK: Featured Post</a> 177 <?php } 133 178 echo $after_widget; // end widget 134 179 -
akfeatured-post-widget/trunk/readme.txt
r534209 r534339 8 8 Contributors: Kaser\ 9 9 Donate Link: http://www.cssboss.com/donate\ 10 Tags : Featured Posts, Post Widget, Category Posts Widget, display posts\10 Tags: Featured Posts, Post Widget, Category Posts Widget, display posts\ 11 11 Requires at least: 3.3\ 12 Tested up to 3.3\12 Tested up to: 3.3\ 13 13 Stable tag: 1.1\ 14 14 \ 15 A simple widget that you can use to display a number of posts (from 1 to 99) from a specific category into any widgetized area of your blog.\16 Watch This Video : {\field{\*\fldinst{HYPERLINK "http://www.youtube.com/watch?v=eWhafkO7uJQ"}}{\fldrslt http://www.youtube.com/watch?v=eWhafkO7uJQ}}\15 A widget that you can use to display posts from a category \ 16 Watch This Video : http://www.youtube.com/watch?v=eWhafkO7uJQ\ 17 17 \ 18 18 == Description ==\ … … 21 21 \ 22 22 Video is more my style, so check out this video tutorial I made for the plugin \ 23 {\field{\*\fldinst{HYPERLINK "http://www.youtube.com/watch?v=eWhafkO7uJQ"}}{\fldrslt http://www.youtube.com/watch?v=eWhafkO7uJQ}}\23 http://www.youtube.com/watch?v=eWhafkO7uJQ\ 24 24 \ 25 25 * You can create custom titles\ … … 35 35 \ 36 36 To manually upload the plugin :\ 37 1. Download and extract the `ak-featured-post` plugin from {\field{\*\fldinst{HYPERLINK "http://wordpress.org/extend/plugins/akfeatured-post-widget/"}}{\fldrslt http://wordpress.org/extend/plugins/akfeatured-post-widget/}}\37 1. Download and extract the `ak-featured-post` plugin from http://wordpress.org/extend/plugins/akfeatured-post-widget/ \ 38 38 2. Upload `ak-featured-post` plugin folder to your wordpress plugin directory, default is `wp-content/plugins/`\ 39 39 3. Activate the plugin through the 'Plugins' menu inside of the wordpress wp-admin dashboard\
Note: See TracChangeset
for help on using the changeset viewer.