Changeset 1736659
- Timestamp:
- 09/26/2017 10:29:19 PM (9 years ago)
- Location:
- wp-recent-posts-extended
- Files:
-
- 2 added
- 6 edited
- 1 copied
-
tags/1.1.2 (copied) (copied from wp-recent-posts-extended/trunk)
-
tags/1.1.2/inc/wprpe.php (modified) (6 diffs)
-
tags/1.1.2/readme.txt (modified) (2 diffs)
-
tags/1.1.2/uninstall.php (added)
-
tags/1.1.2/wp-recent-posts-extended.php (modified) (2 diffs)
-
trunk/inc/wprpe.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/uninstall.php (added)
-
trunk/wp-recent-posts-extended.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-recent-posts-extended/tags/1.1.2/inc/wprpe.php
r832010 r1736659 1 1 <?php 2 /*3 Plugin Name: WP Recent Posts Extended4 Plugin URI: http://vicentegarcia.com5 Description: A simple widget for displaying recent posts by category6 Author: Vicente García7 Author URI: http://vicentegarcia.com8 Author email: v@vicentegarcia.com9 Version: 1.0.110 License: GPLv211 */12 2 13 class wprpe extends WP_Widget 14 { 3 /** 4 * The file that defines the core plugin class 5 * 6 * A class definition that includes attributes and functions used across both the 7 * public-facing side of the site and the admin area. 8 * 9 * @link https://vicentegarcia.com 10 * @since 1.0.0 11 * 12 * @package WP_Recent_Posts_Extended 13 * @subpackage WP_Recent_Posts_Extended/inc 14 */ 15 16 /** 17 * The core plugin class. 18 * 19 * This is used to define internationalization, admin-specific hooks, and 20 * public-facing site hooks. 21 * 22 * Also maintains the unique identifier of this plugin as well as the current 23 * version of the plugin. 24 * 25 * @since 1.0.0 26 * @package WP_Recent_Posts_Extended 27 * @subpackage WP_Recent_Posts_Extended/inc 28 * @author Vicente Garcia <contacto@vicentegarcia.com> 29 */ 30 31 32 class wprpe extends WP_Widget { 33 15 34 public function __construct() 16 35 { 17 36 $wprpe_optionss = array('classname' => 'wprpe', 'description' => "Un sencillo widget para mostrar los últimos artículos por categoría." ); 18 37 parent::__construct('wprpe','WP Recent Posts Extended', $wprpe_optionss); 19 wp_enqueue_style( $this->widgetName.'-styles', plugins_url( 'wprpewidget.css', __FILE__ ));38 wp_enqueue_style( 'wprpe-styles', plugins_url( 'wprpewidget.css', __FILE__ )); 20 39 } 21 40 … … 43 62 { 44 63 $instance = $old_instance; 45 $instance["wprpe_categories_exclude"] = strip_tags($new_instance["wprpe_categories_exclude"]);64 $instance["wprpe_categories_exclude"] = ( ! empty( $new_instance['wprpe_categories_exclude'] ) ) ? strip_tags($new_instance["wprpe_categories_exclude"]) : ''; 46 65 return $instance; 47 66 } … … 49 68 function form($instance) 50 69 { 70 $categories_exclude = empty ($instance['wprpe_categories_exclude']) ? '' : $instance['wprpe_categories_exclude']; 51 71 ?> 52 72 <p> 53 <label for="<?php echo $this->get_field_id('wprpe_categories_exclude'); ?>">Categorías a excluir (separadas por comas)</label> 54 <input class="widefat" id="<?php echo $this->get_field_id('wprpe_categories_exclude'); ?>" name="<?php echo $this->get_field_name('wprpe_categories_exclude'); ?>" type="text" value="<?php echo esc_attr($instance["wprpe_categories_exclude"]); ?>" /> 73 <label for="<?php echo esc_attr ($this->get_field_id('wprpe_categories_exclude')); ?>"> 74 <?php esc_attr_e( 'Categorías a excluir (separadas por comas): ', 'text_domain' ); ?> 75 </label> 76 <input 77 class="widefat" 78 id="<?php echo esc_attr ($this->get_field_id('wprpe_categories_exclude')); ?>" 79 name="<?php echo esc_attr ($this->get_field_name('wprpe_categories_exclude')); ?>" 80 type="text" value="<?php echo $categories_exclude; ?>"> 55 81 </p> 56 82 <?php … … 77 103 78 104 return $stringwprpe; 105 79 106 } 80 107 … … 82 109 { 83 110 global $wpdb, $wp_db_version; 111 112 $notfirst = false; 84 113 85 114 if($category == ''): … … 134 163 foreach ($posts_by_category as $item) 135 164 { 136 $posts_results[] = array('title'=>str_replace('"','',stripslashes($item->post_title)),'permalink'=>post_permalink($item->ID)); 165 // $posts_results[] = array('title'=>str_replace('"','',stripslashes($item->post_title)),'permalink'=>post_permalink($item->ID)); 166 $posts_results[] = array('title'=>str_replace('"','',stripslashes($item->post_title)), 'permalink'=>get_permalink($item->ID)); 137 167 } 138 168 return $posts_results; -
wp-recent-posts-extended/tags/1.1.2/readme.txt
r912289 r1736659 3 3 Tags: posts by category, recent posts, last posts 4 4 Requires at least: 2.5 5 Tested up to: 3.9.16 Stable tag: 1.1. 07 License: GPLv2 5 Tested up to: 4.8 6 Stable tag: 1.1.2 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 9 … … 40 40 == Changelog == 41 41 42 = 1. 0=43 * Versión inicial.42 = 1.1.2 = 43 * Correción de errores. 44 44 45 45 = 1.0.1 = 46 46 * Editado fichero readme.txt 47 48 = 1.0.0 = 49 * Versión inicial. 50 51 -
wp-recent-posts-extended/tags/1.1.2/wp-recent-posts-extended.php
r832010 r1736659 1 1 <?php 2 /* 3 Plugin Name: WP Recent Posts Extended 4 Plugin URI: http://vicentegarcia.com 5 Description: A simple widget for displaying recent posts by category 6 Author: Vicente García 7 Author URI: http://vicentegarcia.com 8 Author email: v@vicentegarcia.com 9 Version: 1.0.1 10 License: GPLv2 11 */ 2 3 /** 4 * WP Recent Posts Extended 5 * 6 * @link https://vicentegarcia.com 7 * @since 1.0.0 8 * @package WP_Recent_Posts_Extended 9 * 10 * @wordpress-plugin 11 * Plugin Name: WP Recent Posts Extended 12 * Plugin URI: https://wordpress.org/plugins/wp-recent-posts-extended/ 13 * Description: A simple widget for displaying recent posts by category. 14 * Version: 1.1.2 15 * Author: Vicente Garcia 16 * Author URI: https://vicentegarcia.com 17 * License: GPL-2.0+ 18 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt 19 * Text Domain: wp-recent-posts-extended 20 * Domain Path: /languages 21 */ 22 23 // If this file is called directly, abort. 24 if ( ! defined( 'WPINC' ) ) { 25 die; 26 } 12 27 13 28 /** 14 29 * Function to register widget 15 30 */ 31 16 32 function wprpe_create_widget(){ 17 33 include_once(plugin_dir_path( __FILE__ ).'/inc/wprpe.php'); … … 19 35 } 20 36 add_action('widgets_init','wprpe_create_widget'); 37 -
wp-recent-posts-extended/trunk/inc/wprpe.php
r832010 r1736659 1 1 <?php 2 /*3 Plugin Name: WP Recent Posts Extended4 Plugin URI: http://vicentegarcia.com5 Description: A simple widget for displaying recent posts by category6 Author: Vicente García7 Author URI: http://vicentegarcia.com8 Author email: v@vicentegarcia.com9 Version: 1.0.110 License: GPLv211 */12 2 13 class wprpe extends WP_Widget 14 { 3 /** 4 * The file that defines the core plugin class 5 * 6 * A class definition that includes attributes and functions used across both the 7 * public-facing side of the site and the admin area. 8 * 9 * @link https://vicentegarcia.com 10 * @since 1.0.0 11 * 12 * @package WP_Recent_Posts_Extended 13 * @subpackage WP_Recent_Posts_Extended/inc 14 */ 15 16 /** 17 * The core plugin class. 18 * 19 * This is used to define internationalization, admin-specific hooks, and 20 * public-facing site hooks. 21 * 22 * Also maintains the unique identifier of this plugin as well as the current 23 * version of the plugin. 24 * 25 * @since 1.0.0 26 * @package WP_Recent_Posts_Extended 27 * @subpackage WP_Recent_Posts_Extended/inc 28 * @author Vicente Garcia <contacto@vicentegarcia.com> 29 */ 30 31 32 class wprpe extends WP_Widget { 33 15 34 public function __construct() 16 35 { 17 36 $wprpe_optionss = array('classname' => 'wprpe', 'description' => "Un sencillo widget para mostrar los últimos artículos por categoría." ); 18 37 parent::__construct('wprpe','WP Recent Posts Extended', $wprpe_optionss); 19 wp_enqueue_style( $this->widgetName.'-styles', plugins_url( 'wprpewidget.css', __FILE__ ));38 wp_enqueue_style( 'wprpe-styles', plugins_url( 'wprpewidget.css', __FILE__ )); 20 39 } 21 40 … … 43 62 { 44 63 $instance = $old_instance; 45 $instance["wprpe_categories_exclude"] = strip_tags($new_instance["wprpe_categories_exclude"]);64 $instance["wprpe_categories_exclude"] = ( ! empty( $new_instance['wprpe_categories_exclude'] ) ) ? strip_tags($new_instance["wprpe_categories_exclude"]) : ''; 46 65 return $instance; 47 66 } … … 49 68 function form($instance) 50 69 { 70 $categories_exclude = empty ($instance['wprpe_categories_exclude']) ? '' : $instance['wprpe_categories_exclude']; 51 71 ?> 52 72 <p> 53 <label for="<?php echo $this->get_field_id('wprpe_categories_exclude'); ?>">Categorías a excluir (separadas por comas)</label> 54 <input class="widefat" id="<?php echo $this->get_field_id('wprpe_categories_exclude'); ?>" name="<?php echo $this->get_field_name('wprpe_categories_exclude'); ?>" type="text" value="<?php echo esc_attr($instance["wprpe_categories_exclude"]); ?>" /> 73 <label for="<?php echo esc_attr ($this->get_field_id('wprpe_categories_exclude')); ?>"> 74 <?php esc_attr_e( 'Categorías a excluir (separadas por comas): ', 'text_domain' ); ?> 75 </label> 76 <input 77 class="widefat" 78 id="<?php echo esc_attr ($this->get_field_id('wprpe_categories_exclude')); ?>" 79 name="<?php echo esc_attr ($this->get_field_name('wprpe_categories_exclude')); ?>" 80 type="text" value="<?php echo $categories_exclude; ?>"> 55 81 </p> 56 82 <?php … … 77 103 78 104 return $stringwprpe; 105 79 106 } 80 107 … … 82 109 { 83 110 global $wpdb, $wp_db_version; 111 112 $notfirst = false; 84 113 85 114 if($category == ''): … … 134 163 foreach ($posts_by_category as $item) 135 164 { 136 $posts_results[] = array('title'=>str_replace('"','',stripslashes($item->post_title)),'permalink'=>post_permalink($item->ID)); 165 // $posts_results[] = array('title'=>str_replace('"','',stripslashes($item->post_title)),'permalink'=>post_permalink($item->ID)); 166 $posts_results[] = array('title'=>str_replace('"','',stripslashes($item->post_title)), 'permalink'=>get_permalink($item->ID)); 137 167 } 138 168 return $posts_results; -
wp-recent-posts-extended/trunk/readme.txt
r912289 r1736659 3 3 Tags: posts by category, recent posts, last posts 4 4 Requires at least: 2.5 5 Tested up to: 3.9.16 Stable tag: 1.1. 07 License: GPLv2 5 Tested up to: 4.8 6 Stable tag: 1.1.2 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 9 … … 40 40 == Changelog == 41 41 42 = 1. 0=43 * Versión inicial.42 = 1.1.2 = 43 * Correción de errores. 44 44 45 45 = 1.0.1 = 46 46 * Editado fichero readme.txt 47 48 = 1.0.0 = 49 * Versión inicial. 50 51 -
wp-recent-posts-extended/trunk/wp-recent-posts-extended.php
r832010 r1736659 1 1 <?php 2 /* 3 Plugin Name: WP Recent Posts Extended 4 Plugin URI: http://vicentegarcia.com 5 Description: A simple widget for displaying recent posts by category 6 Author: Vicente García 7 Author URI: http://vicentegarcia.com 8 Author email: v@vicentegarcia.com 9 Version: 1.0.1 10 License: GPLv2 11 */ 2 3 /** 4 * WP Recent Posts Extended 5 * 6 * @link https://vicentegarcia.com 7 * @since 1.0.0 8 * @package WP_Recent_Posts_Extended 9 * 10 * @wordpress-plugin 11 * Plugin Name: WP Recent Posts Extended 12 * Plugin URI: https://wordpress.org/plugins/wp-recent-posts-extended/ 13 * Description: A simple widget for displaying recent posts by category. 14 * Version: 1.1.2 15 * Author: Vicente Garcia 16 * Author URI: https://vicentegarcia.com 17 * License: GPL-2.0+ 18 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt 19 * Text Domain: wp-recent-posts-extended 20 * Domain Path: /languages 21 */ 22 23 // If this file is called directly, abort. 24 if ( ! defined( 'WPINC' ) ) { 25 die; 26 } 12 27 13 28 /** 14 29 * Function to register widget 15 30 */ 31 16 32 function wprpe_create_widget(){ 17 33 include_once(plugin_dir_path( __FILE__ ).'/inc/wprpe.php'); … … 19 35 } 20 36 add_action('widgets_init','wprpe_create_widget'); 37
Note: See TracChangeset
for help on using the changeset viewer.