Changeset 25882
- Timestamp:
- 10/23/2013 07:46:33 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r25880 r25882 1740 1740 if ( ! $skin->request_filesystem_credentials( false, $context ) || $this->is_vcs_checkout( $context ) ) { 1741 1741 if ( 'core' == $type ) 1742 $this-> notify_core_update( $item );1742 $this->send_core_update_notification_email( $item ); 1743 1743 return false; 1744 1744 } … … 1771 1771 if ( ! $update ) { 1772 1772 if ( 'core' == $type ) 1773 $this-> notify_core_update( $item );1773 $this->send_core_update_notification_email( $item ); 1774 1774 return false; 1775 1775 } … … 1799 1799 * @param object $item The update offer. 1800 1800 */ 1801 protected function notify_core_update( $item ) { 1802 // See if we need to notify users of a core update. 1803 if ( empty( $item->notify_email ) ) 1804 return false; 1805 1801 protected function send_core_update_notification_email( $item ) { 1806 1802 $notify = true; 1807 1803 $notified = get_site_option( 'auto_core_update_notified' ); … … 1809 1805 // Don't notify if we've already notified the same email address of the same version. 1810 1806 if ( $notified && $notified['email'] == get_site_option( 'admin_email' ) && $notified['version'] == $item->current ) 1807 return false; 1808 1809 // See if we need to notify users of a core update. 1810 $notify = ! empty( $item->notify_email ); 1811 1812 /** 1813 * Whether to notify the site administrator of a new core update. 1814 * 1815 * By default, administrators are notified when the update offer received from WordPress.org 1816 * sets a particular flag. This allows for discretion in if and when to notify. 1817 * 1818 * This filter only fires once per release -- if the same email address was already 1819 * notified of the same new version, we won't repeatedly email the administrator. 1820 * 1821 * This filter is also used on about.php to check if a plugin has disabled these notifications. 1822 * 1823 * @since 3.7.0 1824 * 1825 * @param bool $notify Whether the site administrator is notified. 1826 * @param object $item The update offer. 1827 */ 1828 if ( ! apply_filters( 'send_core_update_notification_email', $notify, $item ) ) 1811 1829 return false; 1812 1830 … … 2128 2146 * 2129 2147 * @param bool $send Whether to send the email. Default true. 2130 * @param string $type The type of email to send. Can be one of 'success', 'fail', ' manual', 'critical'.2148 * @param string $type The type of email to send. Can be one of 'success', 'fail', 'critical'. 2131 2149 * @param object $core_update The update offer that was attempted. 2132 2150 * @param mixed $result The result for the core update. Can be WP_Error. 2133 2151 */ 2134 if ( ! apply_filters( 'auto_core_update_send_email', true, $type, $core_update, $result ) )2152 if ( 'manual' !== $type && ! apply_filters( 'auto_core_update_send_email', true, $type, $core_update, $result ) ) 2135 2153 return; 2136 2154
Note: See TracChangeset
for help on using the changeset viewer.