WordPress.org

Make WordPress Core

Ticket #24785: 24785.2.diff

File 24785.2.diff, 577 bytes (added by ericlewis, 5 years ago)

Remove namespacing on the wp_reset_postdata() function, rename to reset_postdata

  • wp-includes/query.php

     
    35683568                global $wp_the_query;
    35693569                return $wp_the_query === $this;
    35703570        }
     3571
     3572        /**
     3573         * After looping through a nested query, this function
     3574         * restores the $post global to the current post in this query
     3575         *
     3576         * @return bool
     3577         */
     3578        function reset_postdata() {
     3579                if ( !empty($this->post) ) {
     3580                        $GLOBALS['post'] = $this->post;
     3581                        setup_postdata($this->post);
     3582                }
     3583        }
    35713584}
    35723585
    35733586/**