Changeset 25815 for trunk/src/wp-admin/includes/class-wp-upgrader.php
- Timestamp:
- 10/16/2013 07:34:05 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r25812 r25815 1602 1602 1603 1603 /** 1604 * Tests to see if we should upgrade a specific item, does not test to see if we CAN update theitem.1604 * Tests to see if we can and should upgrade a specific item. 1605 1605 */ 1606 1606 static function should_auto_update( $type, $item, $context ) { 1607 1608 // Checks to see if WP_Filesystem is set up to allow unattended upgrades. 1609 $skin = new Automatic_Upgrader_Skin; 1610 if ( ! $skin->request_filesystem_credentials( false, $context ) ) 1611 return false; 1607 1612 1608 1613 if ( self::upgrader_disabled() ) … … 1632 1637 return false; 1633 1638 1634 // If it's a core update, are we actually compatible with it 's requirements?1639 // If it's a core update, are we actually compatible with its requirements? 1635 1640 if ( 'core' == $type ) { 1636 1641 global $wpdb; … … 1647 1652 1648 1653 return true; 1649 }1650 1651 // Checks to see if WP_Filesystem is setup to allow unattended upgrades1652 static function can_auto_update( $context, $skin = false ) {1653 if ( ! $skin )1654 $skin = new Automatic_Upgrader_Skin();1655 return (bool) $skin->request_filesystem_credentials( false, $context );1656 1654 } 1657 1655 … … 1681 1679 } 1682 1680 1683 // Determine if we can perform this upgrade or not1684 if ( ! self::should_auto_update( $type, $item, $context ) || ! self::can_auto_update( $context, $skin ))1681 // Determine whether we can and should perform this upgrade. 1682 if ( ! self::should_auto_update( $type, $item, $context ) ) 1685 1683 return false; 1686 1684
Note: See TracChangeset
for help on using the changeset viewer.