Changeset 883564
- Timestamp:
- 03/28/2014 02:00:17 PM (12 years ago)
- File:
-
- 1 edited
-
instamojo/trunk/widget.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
instamojo/trunk/widget.php
r883557 r883564 5 5 * It extends the WordPress Widget class. 6 6 */ 7 class instamojo_widget extends WP_Widget { 7 class instamojo_widget extends WP_Widget 8 { 8 9 9 10 … … 11 12 * Default constructor. 12 13 */ 13 function instamojo_widget() { 14 function instamojo_widget() 15 { 14 16 // Load any other optional scripts 15 17 add_action('load-widgets.php', array(&$this, 'my_custom_load')); … … 33 35 * Called in the constructor. 34 36 */ 35 function my_custom_load() { 37 function my_custom_load() 38 { 36 39 37 40 } … … 41 44 * This is responsible for how the widget looks in your WordPress site. 42 45 */ 43 function widget($args, $instance) { 46 function widget($args, $instance) 47 { 44 48 wp_register_style('widgetcss', plugin_dir_url(__FILE__).'assets/css/imojo.css'); 45 49 wp_enqueue_style('widgetcss'); … … 96 100 * This works when you fill data in the widget form input from the WordPress admin. 97 101 */ 98 function update($new_instance, $old_instance) { 102 function update($new_instance, $old_instance) 103 { 99 104 $instance = $old_instance; 100 105 $instance['button_pos'] = strip_tags($new_instance['button_pos']); … … 128 133 * This is responsible for how the form in the WordPress admin looks. 129 134 */ 130 function form($instance) { 135 function form($instance) 136 { 131 137 $defaults = array('title' => '', 'instamojo_url' => '', 'button_pos' => 'top', 'button_style' => 'none', 'type' => true); 132 138 $instance = wp_parse_args((array)$instance, $defaults);
Note: See TracChangeset
for help on using the changeset viewer.