From 879cb8231b8963d9484755b41dc4aae71a04d4ce Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 10 Sep 2012 17:00:11 +0000 Subject: [PATCH] Remove unnecessary return by refs. Props wonderboymusic. fixes #21839 git-svn-id: https://develop.svn.wordpress.org/trunk@21792 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/category.php | 8 ++++---- wp-includes/class-oembed.php | 2 +- wp-includes/comment.php | 4 ++-- wp-includes/http.php | 2 +- wp-includes/l10n.php | 2 +- wp-includes/pomo/mo.php | 2 +- wp-includes/post.php | 8 ++++---- wp-includes/query.php | 6 +++--- wp-includes/taxonomy.php | 8 ++++---- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/wp-includes/category.php b/wp-includes/category.php index 17283d01a9..7584b21537 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -36,7 +36,7 @@ function get_all_category_ids() { * @param string|array $args Optional. Change the defaults retrieving categories. * @return array List of categories. */ -function &get_categories( $args = '' ) { +function get_categories( $args = '' ) { $defaults = array( 'taxonomy' => 'category' ); $args = wp_parse_args( $args, $defaults ); @@ -78,7 +78,7 @@ function &get_categories( $args = '' ) { * @param string $filter Optional. Default is raw or no WordPress defined filter will applied. * @return mixed Category data in type defined by $output parameter. */ -function &get_category( $category, $output = OBJECT, $filter = 'raw' ) { +function get_category( $category, $output = OBJECT, $filter = 'raw' ) { $category = get_term( $category, 'category', $output, $filter ); if ( is_wp_error( $category ) ) return $category; @@ -249,7 +249,7 @@ function sanitize_category_field( $field, $value, $cat_id, $context ) { * @param string|array $args Tag arguments to use when retrieving tags. * @return array List of tags. */ -function &get_tags( $args = '' ) { +function get_tags( $args = '' ) { $tags = get_terms( 'post_tag', $args ); if ( empty( $tags ) ) { @@ -280,7 +280,7 @@ function &get_tags( $args = '' ) { * @param string $filter Optional. Default is raw or no WordPress defined filter will applied. * @return object|array Return type based on $output value. */ -function &get_tag( $tag, $output = OBJECT, $filter = 'raw' ) { +function get_tag( $tag, $output = OBJECT, $filter = 'raw' ) { return get_term( $tag, 'post_tag', $output, $filter ); } diff --git a/wp-includes/class-oembed.php b/wp-includes/class-oembed.php index f2fc024702..8a59d68865 100644 --- a/wp-includes/class-oembed.php +++ b/wp-includes/class-oembed.php @@ -296,7 +296,7 @@ class WP_oEmbed { * * @return WP_oEmbed object. */ -function &_wp_oembed_get_object() { +function _wp_oembed_get_object() { static $wp_oembed; if ( is_null($wp_oembed) ) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index aaf19d6b90..8fab9f0c4d 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -127,7 +127,7 @@ function get_approved_comments($post_id) { * @param string $output Optional. OBJECT or ARRAY_A or ARRAY_N constants. * @return object|array|null Depends on $output value. */ -function &get_comment(&$comment, $output = OBJECT) { +function get_comment(&$comment, $output = OBJECT) { global $wpdb; $null = null; @@ -723,7 +723,7 @@ function check_comment_flood_db( $ip, $email, $date ) { * @param array $comments Array of comments * @return array Array of comments keyed by comment_type. */ -function &separate_comments(&$comments) { +function separate_comments(&$comments) { $comments_by_type = array('comment' => array(), 'trackback' => array(), 'pingback' => array(), 'pings' => array()); $count = count($comments); for ( $i = 0; $i < $count; $i++ ) { diff --git a/wp-includes/http.php b/wp-includes/http.php index dd9df6e73f..0fcca76241 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -19,7 +19,7 @@ * * @return WP_Http HTTP Transport object. */ -function &_wp_http_get_object() { +function _wp_http_get_object() { static $http; if ( is_null($http) ) diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 7ec3c426aa..77d9790b92 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -493,7 +493,7 @@ function load_child_theme_textdomain( $domain, $path = false ) { * @param string $domain * @return object A Translation instance */ -function &get_translations_for_domain( $domain ) { +function get_translations_for_domain( $domain ) { global $l10n; if ( !isset( $l10n[$domain] ) ) { $l10n[$domain] = new NOOP_Translations; diff --git a/wp-includes/pomo/mo.php b/wp-includes/pomo/mo.php index d76cda5c6b..4d93e3eeb1 100644 --- a/wp-includes/pomo/mo.php +++ b/wp-includes/pomo/mo.php @@ -215,7 +215,7 @@ class MO extends Gettext_Translations { * @param string $translation translation string from MO file. Might contain * 0x00 as a plural translations separator */ - function &make_entry($original, $translation) { + function make_entry($original, $translation) { $entry = new Translation_Entry(); // look for context $parts = explode(chr(4), $original); diff --git a/wp-includes/post.php b/wp-includes/post.php index 7b5fb7e13c..d7806c087b 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -3370,7 +3370,7 @@ function get_page_by_title($page_title, $output = OBJECT, $post_type = 'page' ) * @param array $pages List of pages' objects. * @return array */ -function &get_page_children($page_id, $pages) { +function get_page_children($page_id, $pages) { $page_list = array(); foreach ( (array) $pages as $page ) { if ( $page->post_parent == $page_id ) { @@ -3394,7 +3394,7 @@ function &get_page_children($page_id, $pages) { * @param int $page_id Parent page ID. * @return array A list arranged by hierarchy. Children immediately follow their parents. */ -function &get_page_hierarchy( &$pages, $page_id = 0 ) { +function get_page_hierarchy( &$pages, $page_id = 0 ) { if ( empty( $pages ) ) { $result = array(); return $result; @@ -3462,7 +3462,7 @@ function get_page_uri($page) { * @param mixed $args Optional. Array or string of options that overrides defaults. * @return array List of pages matching defaults or $args */ -function &get_pages($args = '') { +function get_pages($args = '') { global $wpdb; $pages = false; @@ -4950,7 +4950,7 @@ function _wp_put_post_revision( $post = null, $autosave = false ) { * @param string $filter Optional sanitation filter. @see sanitize_post() * @return mixed Null if error or post object if success */ -function &wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') { +function wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') { $null = null; if ( !$revision = get_post( $post, OBJECT, $filter ) ) return $revision; diff --git a/wp-includes/query.php b/wp-includes/query.php index 5c6897caa1..03d29fc801 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -86,7 +86,7 @@ function set_query_var($var, $value) { * @param string $query * @return array List of posts */ -function &query_posts($query) { +function query_posts($query) { unset($GLOBALS['wp_query']); $GLOBALS['wp_query'] = new WP_Query(); return $GLOBALS['wp_query']->query($query); @@ -1916,7 +1916,7 @@ class WP_Query { * * @return array List of posts. */ - function &get_posts() { + function get_posts() { global $wpdb, $user_ID, $_wp_using_ext_object_cache; $this->parse_query(); @@ -2936,7 +2936,7 @@ class WP_Query { * @param string $query URL query string. * @return array List of posts. */ - function &query( $query ) { + function query( $query ) { $this->init(); $this->query = $this->query_vars = wp_parse_args( $query ); return $this->get_posts(); diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 777591fb5f..e8485d4665 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -861,7 +861,7 @@ class WP_Tax_Query { * @return mixed|null|WP_Error Term Row from database. Will return null if $term is empty. If taxonomy does not * exist then WP_Error will be returned. */ -function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') { +function get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') { global $wpdb; $null = null; @@ -1178,7 +1178,7 @@ function get_term_to_edit( $id, $taxonomy ) { * @param string|array $args The values of what to search for when returning terms * @return array|WP_Error List of Term Objects and their children. Will return WP_Error, if any of $taxonomies do not exist. */ -function &get_terms($taxonomies, $args = '') { +function get_terms($taxonomies, $args = '') { global $wpdb; $empty_array = array(); @@ -2637,7 +2637,7 @@ function clean_term_cache($ids, $taxonomy = '', $clean_taxonomy = true) { * @param string $taxonomy Taxonomy Name * @return bool|array Empty array if $terms found, but not $taxonomy. False if nothing is in cache for $taxonomy and $id. */ -function &get_object_term_cache($id, $taxonomy) { +function get_object_term_cache($id, $taxonomy) { $cache = wp_cache_get($id, "{$taxonomy}_relationships"); return $cache; } @@ -2783,7 +2783,7 @@ function _get_term_hierarchy($taxonomy) { * @param string $taxonomy The taxonomy which determines the hierarchy of the terms. * @return array The subset of $terms that are descendants of $term_id. */ -function &_get_term_children($term_id, $terms, $taxonomy) { +function _get_term_children($term_id, $terms, $taxonomy) { $empty_array = array(); if ( empty($terms) ) return $empty_array;