Changeset 1537473
- Timestamp:
- 11/21/2016 11:23:32 AM (9 years ago)
- Location:
- when-is-update/trunk
- Files:
-
- 3 edited
-
index.js (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
rust-update-time.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
when-is-update/trunk/index.js
r1472164 r1537473 33 33 longname : "When Is Update", 34 34 author : "Pauli 'Dids' Jokela", 35 version : "1.0. 6"35 version : "1.0.7" 36 36 }; 37 37 } -
when-is-update/trunk/readme.txt
r1472164 r1537473 4 4 Tags: whenisupdate, rust, when, update, game, playrust 5 5 Requires at least: 3.5.2 6 Tested up to: 4. 5.36 Tested up to: 4.6.1 7 7 Stable tag: trunk 8 8 License: GPLv2 or later … … 29 29 = How do I use this again? = 30 30 31 There are t woways to add the image banner:31 There are three ways to add the image banner: 32 32 33 33 1. Use the `When Is Update` buttons in either the Text or the Visual editor 34 34 2. Simply include the shortcode `[whenisupdate]` anywhere on your site 35 3. Use the included widget 35 36 36 37 You can also change the alignment like this: … … 49 50 50 51 == Changelog == 52 53 = 1.0.7 = 54 * Added a simple widget 51 55 52 56 = 1.0.6 = -
when-is-update/trunk/rust-update-time.php
r1472379 r1537473 4 4 * Plugin URI: https://whenisupdate.com 5 5 * Description: Provides a dynamic image banner for whenisupdate.com. 6 * Version: 1.0. 66 * Version: 1.0.7 7 7 * Author: Pauli 'Dids' Jokela 8 8 * Author URI: http://paulijokela.com … … 214 214 } 215 215 216 // Creating the widget 217 class whenisupdate_widget extends WP_Widget 218 { 219 function __construct() 220 { 221 parent::__construct( 222 // Base ID of your widget 223 'whenisupdate_widget', 224 225 // Widget name will appear in UI 226 __('When Is Update', 'whenisupdate_widget_domain'), 227 228 // Widget description 229 array( 'description' => __('Provides a banner image for whenisupdate.com', 'whenisupdate_widget_domain'), ) 230 ); 231 } 232 233 // Creating widget front-end 234 // This is where the action happens 235 public function widget($args, $instance) 236 { 237 $title = apply_filters('widget_title', $instance['title']); 238 239 // before and after widget arguments are defined by themes 240 echo $args['before_widget']; 241 242 if (!empty($title)) echo $args['before_title'] . $title . $args['after_title']; 243 244 // This is where you run the code and display the output 245 echo __(whenisupdate_widget_code(), 'whenisupdate_widget_domain'); 246 echo $args['after_widget']; 247 } 248 249 // Widget Backend 250 public function form($instance) 251 { 252 if (isset($instance['title'])) 253 { 254 $title = $instance['title']; 255 } 256 else 257 { 258 $title = __('When Is Update', 'whenisupdate_widget_domain'); 259 } 260 261 // Widget admin form 262 ?> 263 <p> 264 <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> 265 <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /> 266 </p> 267 <?php 268 } 269 270 // Updating widget replacing old instances with new 271 public function update($new_instance, $old_instance) 272 { 273 $instance = array(); 274 $instance['title'] = (!empty($new_instance['title'])) ? strip_tags($new_instance['title']) : ''; 275 return $instance; 276 } 277 } // Class whenisupdate_widget ends here 278 279 function whenisupdate_widget_code() 280 { 281 $options = get_option('when_is_update_option_name', array()); 282 $attribute = isset($options['attribute_link_enabled']) && $options['attribute_link_enabled']; 283 return getBannerCode($attribute, $align); 284 } 285 286 // Register and load the widget 287 function whenisupdate_load_widget() 288 { 289 register_widget('whenisupdate_widget'); 290 } 291 add_action('widgets_init', 'whenisupdate_load_widget'); 292 216 293 if (is_admin()) $when_is_update_settings_page = new WhenIsUpdateSettingsPage();
Note: See TracChangeset
for help on using the changeset viewer.