Make WordPress Core

Ticket #56952: 56952.diff

File 56952.diff, 641 bytes (added by oakesjosh, 2 years ago)

Proposed patch

  • src/wp-includes/class-wp-user-query.php

    diff --git a/src/wp-includes/class-wp-user-query.php b/src/wp-includes/class-wp-user-query.php
    index 330882494e..25031ff142 100644
    a b class WP_User_Query { 
    840840                                $result->id = $result->ID;
    841841                        }
    842842                } elseif ( 'all_with_meta' === $qv['fields'] || 'all' === $qv['fields'] ) {
    843                         cache_users( $this->results );
     843
     844                        // Pluggable.php might not be loaded when this code is executed.
     845                        if ( function_exists( 'cache_users' ) ) {
     846                                cache_users( $this->results );
     847                        }
    844848
    845849                        $r = array();
    846850                        foreach ( $this->results as $userid ) {