Plugin Directory

Changeset 1736659


Ignore:
Timestamp:
09/26/2017 10:29:19 PM (9 years ago)
Author:
vicengd
Message:

Update files

Location:
wp-recent-posts-extended
Files:
2 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wp-recent-posts-extended/tags/1.1.2/inc/wprpe.php

    r832010 r1736659  
    11<?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 */
    122
    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
     32class wprpe extends WP_Widget {
     33
    1534    public function __construct()
    1635    {
    1736        $wprpe_optionss = array('classname' => 'wprpe', 'description' => "Un sencillo widget para mostrar los últimos artículos por categoría." );
    1837        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__ ));
    2039    }
    2140
     
    4362    {
    4463        $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"]) : '';
    4665        return $instance;
    4766    }
     
    4968    function form($instance)
    5069    {
     70        $categories_exclude = empty ($instance['wprpe_categories_exclude']) ? '' : $instance['wprpe_categories_exclude'];
    5171        ?>
    5272         <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; ?>">
    5581        </p>
    5682         <?php
     
    77103
    78104        return $stringwprpe;
     105
    79106    }
    80107
     
    82109    {
    83110        global $wpdb, $wp_db_version;
     111
     112        $notfirst = false;
    84113
    85114        if($category == ''):
     
    134163            foreach ($posts_by_category as $item)
    135164            {
    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));
    137167            }
    138168            return $posts_results;
  • wp-recent-posts-extended/tags/1.1.2/readme.txt

    r912289 r1736659  
    33Tags: posts by category, recent posts, last posts
    44Requires at least: 2.5
    5 Tested up to: 3.9.1
    6 Stable tag: 1.1.0
    7 License: GPLv2
     5Tested up to: 4.8
     6Stable tag: 1.1.2
     7License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    99
     
    4040== Changelog ==
    4141
    42 = 1.0 =
    43 * Versión inicial.
     42= 1.1.2 =
     43* Correción de errores.
    4444
    4545= 1.0.1 =
    4646* 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  
    11<?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.
     24if ( ! defined( 'WPINC' ) ) {
     25    die;
     26}
    1227
    1328/**
    1429 * Function to register widget
    1530 */
     31
    1632function wprpe_create_widget(){
    1733    include_once(plugin_dir_path( __FILE__ ).'/inc/wprpe.php');
     
    1935}
    2036add_action('widgets_init','wprpe_create_widget');
     37
  • wp-recent-posts-extended/trunk/inc/wprpe.php

    r832010 r1736659  
    11<?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 */
    122
    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
     32class wprpe extends WP_Widget {
     33
    1534    public function __construct()
    1635    {
    1736        $wprpe_optionss = array('classname' => 'wprpe', 'description' => "Un sencillo widget para mostrar los últimos artículos por categoría." );
    1837        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__ ));
    2039    }
    2140
     
    4362    {
    4463        $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"]) : '';
    4665        return $instance;
    4766    }
     
    4968    function form($instance)
    5069    {
     70        $categories_exclude = empty ($instance['wprpe_categories_exclude']) ? '' : $instance['wprpe_categories_exclude'];
    5171        ?>
    5272         <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; ?>">
    5581        </p>
    5682         <?php
     
    77103
    78104        return $stringwprpe;
     105
    79106    }
    80107
     
    82109    {
    83110        global $wpdb, $wp_db_version;
     111
     112        $notfirst = false;
    84113
    85114        if($category == ''):
     
    134163            foreach ($posts_by_category as $item)
    135164            {
    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));
    137167            }
    138168            return $posts_results;
  • wp-recent-posts-extended/trunk/readme.txt

    r912289 r1736659  
    33Tags: posts by category, recent posts, last posts
    44Requires at least: 2.5
    5 Tested up to: 3.9.1
    6 Stable tag: 1.1.0
    7 License: GPLv2
     5Tested up to: 4.8
     6Stable tag: 1.1.2
     7License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    99
     
    4040== Changelog ==
    4141
    42 = 1.0 =
    43 * Versión inicial.
     42= 1.1.2 =
     43* Correción de errores.
    4444
    4545= 1.0.1 =
    4646* 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  
    11<?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.
     24if ( ! defined( 'WPINC' ) ) {
     25    die;
     26}
    1227
    1328/**
    1429 * Function to register widget
    1530 */
     31
    1632function wprpe_create_widget(){
    1733    include_once(plugin_dir_path( __FILE__ ).'/inc/wprpe.php');
     
    1935}
    2036add_action('widgets_init','wprpe_create_widget');
     37
Note: See TracChangeset for help on using the changeset viewer.