Changeset 1191394
- Timestamp:
- 07/02/2015 07:06:06 PM (11 years ago)
- Location:
- ifgathering-fundraising-widget/trunk
- Files:
-
- 2 edited
-
ifg-fundraiser.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ifgathering-fundraising-widget/trunk/ifg-fundraiser.php
r1072837 r1191394 9 9 Description: This plugin is a widget you can use to install on your site and display the fundraiser results 10 10 Author: Bryan Monzon 11 Version: 1. 211 Version: 1.3 12 12 Author URI: http://fiftyandfifty.org 13 13 */ … … 21 21 { 22 22 23 24 23 25 // constructor 24 function ifg_fundraiser_widget()26 public function __construct( $arr = array() ) 25 27 { 26 /* ... */ 27 parent::WP_Widget(false, $name = __('IF:Gathering Widget', 'ifg_fundraiser_widget') ); 28 } 29 30 // widget form creation 31 function form( $instance ) 32 { 33 /* ... */ 34 // Check values 35 if( $instance ) { 36 $title = esc_attr( $instance['title'] ); 37 } else { 38 $title = ''; 39 40 } 41 ?> 42 <p><em>This widget is not responsive and requires the minimum width to be 350px</em></p> 43 <p> 44 <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'dntly'); ?></label> 45 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /> 46 </p> 47 48 49 <p style="display:block; clear:both;"></p> 50 51 52 53 54 <?php 55 } 56 57 // widget update 58 function update( $new_instance, $old_instance ) 59 { 60 /* ... */ 61 $instance = $old_instance; 62 // Fields 63 $instance['title'] = strip_tags( $new_instance['title'] ); 64 65 66 return $instance; 28 29 parent::__construct( 30 'ifg_fundraiser_widget', // Base ID 31 __( 'IF:Gathering Widget', 'ifg_fundraiser_widget' ), // Name 32 array( 'description' => __( 'A simple widget to show IF:Gathering\'s fundraiser progress', 'ifg_fundraiser_widget' ), ) // Args 33 ); 67 34 } 68 35 69 36 // widget display 70 function widget( $args, $instance ) {37 public function widget( $args, $instance ) { 71 38 /* ... */ 72 39 … … 96 63 97 64 } 65 66 // widget form creation 67 public function form( $instance ) 68 { 69 /* ... */ 70 // Check values 71 if( $instance ) { 72 $title = esc_attr( $instance['title'] ); 73 } else { 74 $title = ''; 75 76 } 77 ?> 78 <p><em>This widget is not responsive and requires the minimum width to be 350px</em></p> 79 <p> 80 <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'dntly'); ?></label> 81 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /> 82 </p> 83 84 85 <p style="display:block; clear:both;"></p> 86 87 88 89 90 <?php 91 } 92 93 // widget update 94 public function update( $new_instance, $old_instance ) 95 { 96 /* ... */ 97 $instance = $old_instance; 98 // Fields 99 $instance['title'] = strip_tags( $new_instance['title'] ); 100 101 102 return $instance; 103 } 104 105 98 106 } 99 107 // register widget 100 add_action('widgets_init', create_function('', 'return register_widget("ifg_fundraiser_widget");'));101 108 109 /** 110 * Register the Widget 111 * @return [type] [description] 112 */ 113 function register_if_gathering_widget() { 114 register_widget( 'ifg_fundraiser_widget' ); 115 } 116 add_action( 'widgets_init', 'register_if_gathering_widget' ); 117 118 119 /** 120 * [ifg_fundraiser_shortcode description] 121 * @param [type] $atts [description] 122 * @param [type] $content [description] 123 * @return [type] [description] 124 */ 102 125 function ifg_fundraiser_shortcode( $atts, $content=null ) 103 126 { -
ifgathering-fundraising-widget/trunk/readme.txt
r1072837 r1191394 4 4 Requires at least: 3.0 5 5 Tested up to: 4.1 6 Stable tag: 1. 26 Stable tag: 1.3 7 7 8 8 Display fundraiser widget for IF:Gathering fundraising needs. … … 52 52 == Changelog == 53 53 54 = 1.3 = 55 * Fix widget class constructor 56 54 57 = 1.2 = 55 58 * Fix comma placement
Note: See TracChangeset
for help on using the changeset viewer.