Changeset 1389518
- Timestamp:
- 04/07/2016 04:23:39 PM (10 years ago)
- Location:
- widget-labels
- Files:
-
- 11 added
- 2 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/i18n.php (added)
-
tags/1.1.0/index.php (added)
-
tags/1.1.0/js (added)
-
tags/1.1.0/js/index.php (added)
-
tags/1.1.0/js/widget-labels.js (added)
-
tags/1.1.0/readme.txt (added)
-
tags/1.1.0/widget-labels.php (added)
-
trunk/i18n.php (added)
-
trunk/index.php (added)
-
trunk/js/index.php (added)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/widget-labels.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
widget-labels/trunk/readme.txt
r1389455 r1389518 1 1 === Widget Labels === 2 Contributors: GenerateWP, maor 2 Contributors: GenerateWP, maor, ramiy 3 3 Tags: widgets, widget label, label, widget 4 4 Requires at least: 4.0 5 Tested up to: 4. 4.26 Stable tag: trunk5 Tested up to: 4.5 6 Stable tag: 1.1.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 18 18 In the meanwhile — enjoy, and feel free to contribute / send pull requests our way [over at GitHub](https://github.com/maor/wp-widget-labels). 19 19 20 21 20 == Screenshots == 22 21 … … 25 24 == Changelog == 26 25 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 27 32 = 1.0.0 - April 6, 2016 = 28 33 * Initial release. -
widget-labels/trunk/widget-labels.php
r1389455 r1389518 4 4 Plugin URI: https://wordpress.org/plugins/widget-labels/ 5 5 Description: Allows you to use custom labels/titles for any of your Widgets 6 Version: 1. 0.06 Version: 1.1.0 7 7 Author: Maor Chasen 8 8 Author URI: https://generatewp.com/ … … 10 10 */ 11 11 12 13 14 /** 15 * Security check 16 * Prevent direct access to the file. 17 * 18 * @since 1.1.0 19 */ 20 if ( ! defined( 'ABSPATH' ) ) { 21 exit; 22 } 23 24 25 26 /** 27 * Include plugin files 28 */ 29 include_once ( plugin_dir_path( __FILE__ ) . 'i18n.php' ); 30 31 32 12 33 final 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 */ 13 45 private static $instance; 14 46 … … 16 48 * Kickoff 17 49 * 50 * @since 1.0.0 51 * @access public 18 52 * @static 19 * @since 1.0.020 53 */ 21 54 public static function instance() { … … 30 63 * Setup hooks 31 64 * 32 * @static 65 * Fire the plugin hooks. 66 * 33 67 * @since 1.0.0 68 * @access public 34 69 */ 35 70 public function setup_actions() { … … 40 75 41 76 /** 42 * Add s form fields to Widget77 * Add Fields 43 78 * 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. 48 87 * @return array 49 * @since 1.0.050 88 */ 51 89 public function filter_in_widget_form( $widget, $return, $instance ) { … … 59 97 60 98 /** 61 * Updates the Widget with the classes99 * Widget update 62 100 * 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. 66 108 * @return array 67 * @since 1.0.068 109 */ 69 public function filter_widget_update_callback( $ instance, $new_instance ) {110 public function filter_widget_update_callback( $old_instance, $new_instance ) { 70 111 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']; 72 113 } else { 73 unset( $ instance['mc_widget_label'] );114 unset( $old_instance['mc_widget_label'] ); 74 115 } 75 116 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; 78 119 } 79 120 80 121 /** 122 * Load scripts 123 * 81 124 * Enqueues various "scripts n' styles" as I like to call it. 82 125 * 83 126 * @since 1.0.0 127 * @access public 84 128 */ 85 129 public function scripts_n_styles() {
Note: See TracChangeset
for help on using the changeset viewer.