Changeset 884545
- Timestamp:
- 03/30/2014 09:42:11 AM (12 years ago)
- Location:
- instamojo/trunk
- Files:
-
- 1 deleted
- 1 edited
-
assets (deleted)
-
widget.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
instamojo/trunk/widget.php
r884496 r884545 48 48 function widget($args, $instance) 49 49 { 50 wp_register_s tyle('widgetcss', plugin_dir_url(__FILE__).'assets/css/imojo.css');51 wp_enqueue_s tyle('widgetcss');50 wp_register_script('widgetjs', 'https://d2xwmjc4uy2hr5.cloudfront.net/im-embed/im-embed.min.js', 'jquery', null, true); 51 wp_enqueue_script('widgetjs'); 52 52 53 53 $instamojo_credentials = get_option('instamojo_credentials'); … … 69 69 } 70 70 71 $button_html = '<div class="btn-container"><a href="https://www.instamojo.com/'.$instamojo_credentials['username'].'/'.$instance['instamojo_offer'].'" '; 72 if ($instance['button_style'] != 'none') { 73 $button_html .= 'class="im-checkout-btn btn--'.$instance['button_style'].'" '; 74 } 75 $button_html .= 'target="_blank">Buy Now</a></div>'; 71 $button_html = '<a href="https://www.instamojo.com/'.$instamojo_credentials['username'].'/'.$instance['instamojo_offer'].'/" rel="im-checkout" data-style="'.$instance['button_style'].'" data-text="'.$instance['button_text'].'"></a>'; 76 72 echo $button_html; 77 73 echo $after_widget; … … 84 80 function update($new_instance, $old_instance) 85 81 { 86 $instance = $ old_instance;82 $instance = $new_instance; 87 83 return $instance; 88 84 } … … 94 90 function form($instance) 95 91 { 96 $defaults = array('title' => '', ' instamojo_offer' => '', 'button_style' => 'none');92 $defaults = array('title' => '', 'button_text' => 'Checkout with Instamojo', 'instamojo_offer' => '', 'button_style' => 'none'); 97 93 $instance = wp_parse_args((array)$instance, $defaults); 98 94 … … 117 113 name="<?php echo $this->get_field_name('title');?>" 118 114 value="<?php echo $instance['title'];?>" /> 115 </p> 116 <p> 117 <label for="<?php echo $this->get_field_id('button_text');?>">Button Text:</label> 118 <input class="widefat" id="<?php echo $this->get_field_id('button_text');?>" 119 name="<?php echo $this->get_field_name('button_text');?>" 120 value="<?php echo $instance['button_text'];?>" /> 119 121 </p> 120 122 <p>
Note: See TracChangeset
for help on using the changeset viewer.