Ticket #64553: option-docblock-cleanup.patch
| File option-docblock-cleanup.patch, 3.0 KB (added by , 6 weeks ago) |
|---|
-
wp-includes/option.php
(this hunk was shorter than expected) 1634 1634 * 1635 1635 * @global wpdb $wpdb WordPress database abstraction object. 1636 1636 * 1637 * @param bool $force_db Optional. Force cleanup to run against the database even when an external object cache is used. 1637 * @param bool $force_db Optional. Force cleanup to run against the database even when an external object cache is used. 1638 * Default false. 1639 * @param string|bool $name Optional. Transient name or prefix. If provided, only expired transients 1640 * matching this name or prefix will be deleted. Default false. 1638 1641 */ 1639 function delete_expired_transients( $force_db = false ) {1642 function delete_expired_transients( $force_db = false, $name = false ) { 1640 1643 global $wpdb; 1641 1644 1642 1645 if ( ! $force_db && wp_using_ext_object_cache() ) { … … 1643 1648 return; 1644 1649 } 1645 1650 1651 $transient_like = $wpdb->esc_like( '_transient_' . ( $name ? $name : '' ) ) . '%'; 1652 $timeout_like = $wpdb->esc_like( '_transient_timeout_' ) . '%'; 1653 1646 1654 $wpdb->query( 1647 1655 $wpdb->prepare( 1648 1656 "DELETE a, b FROM {$wpdb->options} a, {$wpdb->options} b … … 1650 1658 AND a.option_name NOT LIKE %s 1651 1659 AND b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, 12 ) ) 1652 1660 AND b.option_value < %d", 1653 $ wpdb->esc_like( '_transient_' ) . '%',1654 $ wpdb->esc_like( '_transient_timeout_' ) . '%',1661 $transient_like, 1662 $timeout_like, 1655 1663 time() 1656 1664 ) 1657 1665 ); … … (this hunk was shorter than expected) 1659 1667 if ( ! is_multisite() ) { 1668 $site_transient_like = $wpdb->esc_like( '_site_transient_' . ( $name ? $name : '' ) ) . '%'; 1669 $site_timeout_like = $wpdb->esc_like( '_site_transient_timeout_' ) . '%'; 1670 1660 1671 // Single site stores site transients in the options table. 1661 1672 $wpdb->query( 1662 1673 $wpdb->prepare( … … 1667 1678 AND a.option_name NOT LIKE %s 1668 1679 AND b.option_name = CONCAT( '_site_transient_timeout_', SUBSTRING( a.option_name, 17 ) ) 1669 1680 AND b.option_value < %d", 1670 $ wpdb->esc_like( '_site_transient_' ) . '%',1671 $ wpdb->esc_like( '_site_transient_timeout_' ) . '%',1681 $site_transient_like, 1682 $site_timeout_like, 1672 1683 time() 1673 1684 ) 1674 1685 ); … … (this hunk was shorter than expected) 1676 1687 } elseif ( is_main_site() && is_main_network() ) { 1688 $site_transient_like = $wpdb->esc_like( '_site_transient_' . ( $name ? $name : '' ) ) . '%'; 1689 $site_timeout_like = $wpdb->esc_like( '_site_transient_timeout_' ) . '%'; 1690 1677 1691 // Multisite stores site transients in the sitemeta table. 1678 1692 $wpdb->query( 1679 1693 $wpdb->prepare( … … 1684 1698 AND a.meta_key NOT LIKE %s 1685 1699 AND b.meta_key = CONCAT( '_site_transient_timeout_', SUBSTRING( a.meta_key, 17 ) ) 1686 1700 AND b.meta_value < %d", 1687 $ wpdb->esc_like( '_site_transient_' ) . '%',1688 $ wpdb->esc_like( '_site_transient_timeout_' ) . '%',1701 $site_transient_like, 1702 $site_timeout_like, 1689 1703 time() 1690 1704 ) 1691 1705 );