WordPress.org

Make WordPress Core

Ticket #45662: 45662.diff

File 45662.diff, 5.0 KB (added by spacedmonkey, 13 months ago)
  • src/wp-admin/includes/schema.php

     
    13291329
    13301330        $wpdb->query( "INSERT INTO $wpdb->blogmeta ( blog_id, meta_key, meta_value ) VALUES " . $insert ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
    13311331
    1332         wp_cache_set( 'last_changed', microtime(), 'sites' );
     1332        wp_cache_set_last_changed( 'sites' );
    13331333}
  • src/wp-includes/comment.php

     
    29172917                do_action( 'clean_comment_cache', $id );
    29182918        }
    29192919
    2920         wp_cache_set( 'last_changed', microtime(), 'comment' );
     2920        wp_cache_set_last_changed( 'comment' );
    29212921}
    29222922
    29232923/**
     
    35073507 * @since 5.0.0
    35083508 */
    35093509function wp_cache_set_comments_last_changed() {
    3510         wp_cache_set( 'last_changed', microtime(), 'comment' );
     3510        wp_cache_set_last_changed( 'comment' );
    35113511}
  • src/wp-includes/functions.php

     
    62016201
    62026202        if ( ! $last_changed ) {
    62036203                $last_changed = microtime();
    6204                 wp_cache_set( 'last_changed', $last_changed, $group );
     6204                wp_cache_set_last_changed( $group, $last_changed );
    62056205        }
    62066206
    62076207        return $last_changed;
     
    62086208}
    62096209
    62106210/**
     6211 * Set last changed date for the specified cache group.
     6212 *
     6213 * @since 5.1.0
     6214 *
     6215 * @param string $group Where the cache contents are grouped.
     6216 * @param string|bool (Optional) Pass the value of the last changed otherwise, default to current UNIX timestamp with microseconds.
     6217 *
     6218 * @return bool True is update was successful.
     6219 */
     6220function wp_cache_set_last_changed( $group, $last_changed = false ) {
     6221        if ( false === $last_changed ) {
     6222                $last_changed = microtime();
     6223        }
     6224
     6225        return wp_cache_set( 'last_changed', $last_changed, $group );
     6226}
     6227
     6228/**
    62116229 * Send an email to the old site admin email address when the site admin email address changes.
    62126230 *
    62136231 * @since 4.9.0
  • src/wp-includes/ms-blogs.php

     
    367367         */
    368368        do_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key );
    369369
    370         wp_cache_set( 'last_changed', microtime(), 'sites' );
     370        wp_cache_set_last_changed( 'sites' );
    371371
    372372        /**
    373373         * Fires after the blog details cache is cleared.
     
    14861486
    14871487        // Bust site query cache.
    14881488        if ( $added ) {
    1489                 wp_cache_set( 'last_changed', microtime(), 'sites' );
     1489                wp_cache_set_last_changed( 'sites' );
    14901490        }
    14911491
    14921492        return $added;
     
    15191519
    15201520        // Bust site query cache.
    15211521        if ( $deleted ) {
    1522                 wp_cache_set( 'last_changed', microtime(), 'sites' );
     1522                wp_cache_set_last_changed( 'sites' );
    15231523        }
    15241524
    15251525        return $deleted;
     
    15781578
    15791579        // Bust site query cache.
    15801580        if ( $updated ) {
    1581                 wp_cache_set( 'last_changed', microtime(), 'sites' );
     1581                wp_cache_set_last_changed( 'sites' );
    15821582        }
    15831583
    15841584        return $updated;
     
    16041604
    16051605        // Bust site query cache.
    16061606        if ( $deleted ) {
    1607                 wp_cache_set( 'last_changed', microtime(), 'sites' );
     1607                wp_cache_set_last_changed( 'sites' );
    16081608        }
    16091609
    16101610        return $deleted;
     
    19971997                do_action( 'clean_network_cache', $id );
    19981998        }
    19991999
    2000         wp_cache_set( 'last_changed', microtime(), 'networks' );
     2000        wp_cache_set_last_changed( 'networks' );
    20012001}
    20022002
    20032003/**
  • src/wp-includes/ms-functions.php

     
    13351335                return $blog_id;
    13361336        }
    13371337
    1338         wp_cache_set( 'last_changed', microtime(), 'sites' );
     1338        wp_cache_set_last_changed( 'sites' );
    13391339
    13401340        return $blog_id;
    13411341}
  • src/wp-includes/post.php

     
    63106310                do_action( 'clean_page_cache', $post->ID );
    63116311        }
    63126312
    6313         wp_cache_set( 'last_changed', microtime(), 'posts' );
     6313        wp_cache_set_last_changed( 'posts' );
    63146314}
    63156315
    63166316/**
     
    68366836 * @since 5.0.0
    68376837 */
    68386838function wp_cache_set_posts_last_changed() {
    6839         wp_cache_set( 'last_changed', microtime(), 'posts' );
     6839        wp_cache_set_last_changed( 'posts' );
    68406840}
  • src/wp-includes/taxonomy.php

     
    32543254                do_action( 'clean_term_cache', $ids, $taxonomy, $clean_taxonomy );
    32553255        }
    32563256
    3257         wp_cache_set( 'last_changed', microtime(), 'terms' );
     3257        wp_cache_set_last_changed( 'terms' );
    32583258}
    32593259
    32603260/**
     
    45934593 * @since 5.0.0
    45944594 */
    45954595function wp_cache_set_terms_last_changed() {
    4596         wp_cache_set( 'last_changed', microtime(), 'terms' );
     4596        wp_cache_set_last_changed( 'terms' );
    45974597}
    45984598
    45994599/**