WordPress.org

Make WordPress Core

Ticket #21839: return-by-ref-audit.diff

File return-by-ref-audit.diff, 8.2 KB (added by wonderboymusic, 6 years ago)
  • wp-includes/category.php

     
    3636 * @param string|array $args Optional. Change the defaults retrieving categories.
    3737 * @return array List of categories.
    3838 */
    39 function &get_categories( $args = '' ) {
     39function get_categories( $args = '' ) {
    4040        $defaults = array( 'taxonomy' => 'category' );
    4141        $args = wp_parse_args( $args, $defaults );
    4242
     
    7878 * @param string $filter Optional. Default is raw or no WordPress defined filter will applied.
    7979 * @return mixed Category data in type defined by $output parameter.
    8080 */
    81 function &get_category( $category, $output = OBJECT, $filter = 'raw' ) {
     81function get_category( $category, $output = OBJECT, $filter = 'raw' ) {
    8282        $category = get_term( $category, 'category', $output, $filter );
    8383        if ( is_wp_error( $category ) )
    8484                return $category;
     
    249249 * @param string|array $args Tag arguments to use when retrieving tags.
    250250 * @return array List of tags.
    251251 */
    252 function &get_tags( $args = '' ) {
     252function get_tags( $args = '' ) {
    253253        $tags = get_terms( 'post_tag', $args );
    254254
    255255        if ( empty( $tags ) ) {
     
    280280 * @param string $filter Optional. Default is raw or no WordPress defined filter will applied.
    281281 * @return object|array Return type based on $output value.
    282282 */
    283 function &get_tag( $tag, $output = OBJECT, $filter = 'raw' ) {
     283function get_tag( $tag, $output = OBJECT, $filter = 'raw' ) {
    284284        return get_term( $tag, 'post_tag', $output, $filter );
    285285}
    286286
  • wp-includes/taxonomy.php

     
    859859 * @return mixed|null|WP_Error Term Row from database. Will return null if $term is empty. If taxonomy does not
    860860 * exist then WP_Error will be returned.
    861861 */
    862 function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') {
     862function get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') {
    863863        global $wpdb;
    864864        $null = null;
    865865
     
    11761176 * @param string|array $args The values of what to search for when returning terms
    11771177 * @return array|WP_Error List of Term Objects and their children. Will return WP_Error, if any of $taxonomies do not exist.
    11781178 */
    1179 function &get_terms($taxonomies, $args = '') {
     1179function get_terms($taxonomies, $args = '') {
    11801180        global $wpdb;
    11811181        $empty_array = array();
    11821182
     
    26352635 * @param string $taxonomy Taxonomy Name
    26362636 * @return bool|array Empty array if $terms found, but not $taxonomy. False if nothing is in cache for $taxonomy and $id.
    26372637 */
    2638 function &get_object_term_cache($id, $taxonomy) {
     2638function get_object_term_cache($id, $taxonomy) {
    26392639        $cache = wp_cache_get($id, "{$taxonomy}_relationships");
    26402640        return $cache;
    26412641}
     
    27812781 * @param string $taxonomy The taxonomy which determines the hierarchy of the terms.
    27822782 * @return array The subset of $terms that are descendants of $term_id.
    27832783 */
    2784 function &_get_term_children($term_id, $terms, $taxonomy) {
     2784function _get_term_children($term_id, $terms, $taxonomy) {
    27852785        $empty_array = array();
    27862786        if ( empty($terms) )
    27872787                return $empty_array;
  • wp-includes/pomo/mo.php

     
    215215         * @param string $translation translation string from MO file. Might contain
    216216         *      0x00 as a plural translations separator
    217217         */
    218         function &make_entry($original, $translation) {
     218        function make_entry($original, $translation) {
    219219                $entry = new Translation_Entry();
    220220                // look for context
    221221                $parts = explode(chr(4), $original);
  • wp-includes/post.php

     
    33703370 * @param array $pages List of pages' objects.
    33713371 * @return array
    33723372 */
    3373 function &get_page_children($page_id, $pages) {
     3373function get_page_children($page_id, $pages) {
    33743374        $page_list = array();
    33753375        foreach ( (array) $pages as $page ) {
    33763376                if ( $page->post_parent == $page_id ) {
     
    33943394 * @param int $page_id Parent page ID.
    33953395 * @return array A list arranged by hierarchy. Children immediately follow their parents.
    33963396 */
    3397 function &get_page_hierarchy( &$pages, $page_id = 0 ) {
     3397function get_page_hierarchy( &$pages, $page_id = 0 ) {
    33983398        if ( empty( $pages ) ) {
    33993399                $result = array();
    34003400                return $result;
     
    34623462 * @param mixed $args Optional. Array or string of options that overrides defaults.
    34633463 * @return array List of pages matching defaults or $args
    34643464 */
    3465 function &get_pages($args = '') {
     3465function get_pages($args = '') {
    34663466        global $wpdb;
    34673467
    34683468        $pages = false;
     
    49504950 * @param string $filter Optional sanitation filter. @see sanitize_post()
    49514951 * @return mixed Null if error or post object if success
    49524952 */
    4953 function &wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') {
     4953function wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') {
    49544954        $null = null;
    49554955        if ( !$revision = get_post( $post, OBJECT, $filter ) )
    49564956                return $revision;
  • wp-includes/comment.php

     
    127127 * @param string $output Optional. OBJECT or ARRAY_A or ARRAY_N constants.
    128128 * @return object|array|null Depends on $output value.
    129129 */
    130 function &get_comment(&$comment, $output = OBJECT) {
     130function get_comment(&$comment, $output = OBJECT) {
    131131        global $wpdb;
    132132        $null = null;
    133133
     
    723723 * @param array $comments Array of comments
    724724 * @return array Array of comments keyed by comment_type.
    725725 */
    726 function &separate_comments(&$comments) {
     726function separate_comments(&$comments) {
    727727        $comments_by_type = array('comment' => array(), 'trackback' => array(), 'pingback' => array(), 'pings' => array());
    728728        $count = count($comments);
    729729        for ( $i = 0; $i < $count; $i++ ) {
  • wp-includes/l10n.php

     
    493493 * @param string $domain
    494494 * @return object A Translation instance
    495495 */
    496 function &get_translations_for_domain( $domain ) {
     496function get_translations_for_domain( $domain ) {
    497497        global $l10n;
    498498        if ( !isset( $l10n[$domain] ) ) {
    499499                $l10n[$domain] = new NOOP_Translations;
  • wp-includes/query.php

     
    8686 * @param string $query
    8787 * @return array List of posts
    8888 */
    89 function &query_posts($query) {
     89function query_posts($query) {
    9090        unset($GLOBALS['wp_query']);
    9191        $GLOBALS['wp_query'] = new WP_Query();
    9292        return $GLOBALS['wp_query']->query($query);
     
    19161916         *
    19171917         * @return array List of posts.
    19181918         */
    1919         function &get_posts() {
     1919        function get_posts() {
    19201920                global $wpdb, $user_ID, $_wp_using_ext_object_cache;
    19211921
    19221922                $this->parse_query();
     
    29362936         * @param string $query URL query string.
    29372937         * @return array List of posts.
    29382938         */
    2939         function &query( $query ) {
     2939        function query( $query ) {
    29402940                $this->init();
    29412941                $this->query = $this->query_vars = wp_parse_args( $query );
    29422942                return $this->get_posts();
  • wp-includes/class-oembed.php

     
    296296 *
    297297 * @return WP_oEmbed object.
    298298 */
    299 function &_wp_oembed_get_object() {
     299function _wp_oembed_get_object() {
    300300        static $wp_oembed;
    301301
    302302        if ( is_null($wp_oembed) )
  • wp-includes/http.php

     
    1919 *
    2020 * @return WP_Http HTTP Transport object.
    2121 */
    22 function &_wp_http_get_object() {
     22function _wp_http_get_object() {
    2323        static $http;
    2424
    2525        if ( is_null($http) )