Plugin Directory

Changeset 1389518


Ignore:
Timestamp:
04/07/2016 04:23:39 PM (10 years ago)
Author:
maor
Message:

Update to commit d14b207 from git@…:maor/wp-widget-labels.git

Location:
widget-labels
Files:
11 added
2 edited

Legend:

Unmodified
Added
Removed
  • widget-labels/trunk/readme.txt

    r1389455 r1389518  
    11=== Widget Labels ===
    2 Contributors: GenerateWP, maor
     2Contributors: GenerateWP, maor, ramiy
    33Tags: widgets, widget label, label, widget
    44Requires at least: 4.0
    5 Tested up to: 4.4.2
    6 Stable tag: trunk
     5Tested up to: 4.5
     6Stable tag: 1.1.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1818In the meanwhile — enjoy, and feel free to contribute / send pull requests our way [over at GitHub](https://github.com/maor/wp-widget-labels).
    1919
    20 
    2120== Screenshots ==
    2221
     
    2524== Changelog ==
    2625
     26= 1.1.0 - April 7, 2016 =
     27* Prevent direct access to php files.
     28* Prevent direct access to directories.
     29* Use [translate.wordpress.org](https://translate.wordpress.org/) to translate the plugin.
     30* Add more phpDocs.
     31
    2732= 1.0.0 - April 6, 2016 =
    2833* Initial release.
  • widget-labels/trunk/widget-labels.php

    r1389455 r1389518  
    44Plugin URI:  https://wordpress.org/plugins/widget-labels/
    55Description: Allows you to use custom labels/titles for any of your Widgets
    6 Version:     1.0.0
     6Version:     1.1.0
    77Author:      Maor Chasen
    88Author URI:  https://generatewp.com/
     
    1010*/
    1111
     12
     13
     14/**
     15 * Security check
     16 * Prevent direct access to the file.
     17 *
     18 * @since 1.1.0
     19 */
     20if ( ! defined( 'ABSPATH' ) ) {
     21    exit;
     22}
     23
     24
     25
     26/**
     27 * Include plugin files
     28 */
     29include_once ( plugin_dir_path( __FILE__ ) . 'i18n.php' );
     30
     31
     32
    1233final class MC_Widget_Labels {
     34
     35    /**
     36     * Instance
     37     *
     38     * The current widget instance's settings.
     39     *
     40     * @since 1.0.0
     41     * @access private
     42     * @static
     43     * @var array
     44     */
    1345    private static $instance;
    1446
     
    1648     * Kickoff
    1749     *
     50     * @since 1.0.0
     51     * @access public
    1852     * @static
    19      * @since 1.0.0
    2053     */
    2154    public static function instance() {
     
    3063     * Setup hooks
    3164     *
    32      * @static
     65     * Fire the plugin hooks.
     66     *
    3367     * @since 1.0.0
     68     * @access public
    3469     */
    3570    public function setup_actions() {
     
    4075
    4176    /**
    42      * Adds form fields to Widget
     77     * Add Fields
    4378     *
    44      * @static
    45      * @param $widget
    46      * @param $return
    47      * @param $instance
     79     * Adds fields to the widget form.
     80     *
     81     * @since 1.0.0
     82     * @access public
     83     *
     84     * @param WP_Widget $widget   The current widget instance.
     85     * @param bool      $return   ?
     86     * @param array     $instance The current widget instance's settings.
    4887     * @return array
    49      * @since 1.0.0
    5088     */
    5189    public function filter_in_widget_form( $widget, $return, $instance ) {
     
    5997
    6098    /**
    61      * Updates the Widget with the classes
     99     * Widget update
    62100     *
    63      * @static
    64      * @param $instance
    65      * @param $new_instance
     101     * Updates the Widget with the classes.
     102     *
     103     * @since 1.0.0
     104     * @access public
     105     *
     106     * @param array $old_instance Array of old widget settings.
     107     * @param array $new_instance Array of new widget settings.
    66108     * @return array
    67      * @since 1.0.0
    68109     */
    69     public function filter_widget_update_callback( $instance, $new_instance ) {
     110    public function filter_widget_update_callback( $old_instance, $new_instance ) {
    70111        if ( ! empty( $new_instance['mc_widget_label'] ) ) {
    71             $instance['mc_widget_label'] = $new_instance['mc_widget_label'];
     112            $old_instance['mc_widget_label'] = $new_instance['mc_widget_label'];
    72113        } else {
    73             unset( $instance['mc_widget_label'] );
     114            unset( $old_instance['mc_widget_label'] );
    74115        }
    75116       
    76         do_action( 'widget_labels_update', $instance, $new_instance );
    77         return $instance;
     117        do_action( 'widget_labels_update', $old_instance, $new_instance );
     118        return $old_instance;
    78119    }
    79120
    80121    /**
     122     * Load scripts
     123     *
    81124     * Enqueues various "scripts n' styles" as I like to call it.
    82125     *
    83126     * @since 1.0.0
     127     * @access public
    84128     */
    85129    public function scripts_n_styles() {
Note: See TracChangeset for help on using the changeset viewer.