Changeset 1381607
- Timestamp:
- 03/30/2016 02:25:11 AM (10 years ago)
- Location:
- l7-automatic-updates/trunk
- Files:
-
- 2 edited
-
l7-automatic-updates.php (modified) (11 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
l7-automatic-updates/trunk/l7-automatic-updates.php
r1268310 r1381607 5 5 * Description: Options for setting Wordpress's Automatic updates. 6 6 * Author: Jeffrey S. Mattson 7 * Version: 1.0. 37 * Version: 1.0.4 8 8 * Author URI: http://layer7web.com 9 9 * License: GPL2+ … … 11 11 12 12 /* 13 Copyright 201 5Jeffrey S. Mattson (email : plugins@layer7web.com)13 Copyright 2016 Jeffrey S. Mattson (email : plugins@layer7web.com) 14 14 This program is free software; you can redistribute it and/ or modify 15 15 it under the terms of the GNU General Public License as published by … … 39 39 add_action( 'admin_menu', array( $this, 'l7wau_add_settings_menu' ) ); 40 40 add_action( 'admin_init', array( $this, 'l7wau_register_settings' ) ); 41 } else {42 // do nothing43 41 } 44 42 … … 51 49 // Error notices 52 50 add_action( 'admin_notices', array( $this, 'l7wau_error_notice' ) ); 51 52 // Filter the background update notification email. 53 add_filter( 'auto_core_update_email', array( $this, 'l7w_filter_auto_core_update_email' ), 1 ); 53 54 } 54 55 … … 142 143 add_settings_field( 'l7wau_version', 'Update When Version Control is Detected?', array( $this, 'l7wau_version' ), 'l7-automatic-updates', 'l7wau_top_section', array( 'label_for' => 'l7wau_version' ) ); 143 144 145 // Email setting 146 add_settings_field( 'l7wau_notification_email', 'Send Notification Email To', array( $this, 'l7wau_notification_email' ), 'l7-automatic-updates', 'l7wau_top_section', array( 'label_for' => 'l7wau_version' ) ); 147 144 148 /** 145 149 * Add the plugin checkboxes … … 157 161 echo 'Settings'; 158 162 } 163 159 164 /** 160 165 * Plugins Description … … 222 227 $output = '<input type="checkbox" value="1" id="l7wau_version" name="l7wau_settings_group[version]"' . $checked . ' >'; 223 228 echo $output; 229 } 230 231 /** 232 * Enter email address field 233 */ 234 function l7wau_notification_email(){ 235 $text_string = $this->l7wau_default_settings( 'l7wau_notification_email' ); 236 $content = "<div class='input-group'><span class='input-group-addon'><i></i></span><input id='l7wau_notification_email' name='l7wau_settings_group[l7wau_notification_email]' type='text' value='" . esc_attr( $text_string ) . "' class='form-control' style='width:40%;' /></div><i>Leave blank to send to admin's email. Set in settings -> general.</i>"; 237 echo $content; 224 238 } 225 239 … … 228 242 * is not set then it returns the default value. If the default key is not 229 243 * in the array it returns false. 244 * 230 245 * @param string $key the key value of the setting 231 246 * @return string/boolean … … 397 412 /** 398 413 * Used to set the 'checked' value to the checkboxes. 414 * 399 415 * @param string $name 400 416 */ … … 424 440 /** 425 441 * Returns an array with the plugin names to update. 442 * 426 443 * @return array names of plugins to update. 427 444 */ … … 447 464 return $return_array; 448 465 } 466 467 /** 468 * Filter the background update notification email 469 * 470 * @since 1.0.2 471 * 472 * @param array $email Array of email arguments that will be passed to wp_mail(). 473 * @return array Modified array containing the new email address. 474 */ 475 public function l7w_filter_auto_core_update_email( $email ) { 476 477 // Get plugin settings. 478 $options = get_option( 'l7wau_settings_group' ); 479 480 // If an email address has been set, override the WordPress default. 481 if ( isset( $options['l7wau_notification_email'] ) && ! empty( $options['l7wau_notification_email'] ) ) { 482 $email['to'] = $options['l7wau_notification_email']; 483 } 484 485 return $email; 486 } 449 487 } 450 488 } -
l7-automatic-updates/trunk/readme.txt
r1268298 r1381607 4 4 Tags: automatic, updates, plugins, themes, core, minor, individual 5 5 Requires at least: 3.8.2 6 Tested up to: 4. 37 Stable tag:1.0. 36 Tested up to: 4.4.2 7 Stable tag:1.0.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 57 57 = 1.0.3 = 58 58 59 * Corrected Display Error 60 * JS in now more efficient. 59 * Added the ability to change the notification email recipient. 61 60 62 61 = 1.0.2 =
Note: See TracChangeset
for help on using the changeset viewer.