Remove unnecessary return by refs. Props wonderboymusic. fixes #21839

git-svn-id: http://core.svn.wordpress.org/trunk@21792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan Boren 2012-09-10 17:00:11 +00:00
parent daa6757a9b
commit f483a85676
9 changed files with 21 additions and 21 deletions

View File

@ -36,7 +36,7 @@ function get_all_category_ids() {
* @param string|array $args Optional. Change the defaults retrieving categories. * @param string|array $args Optional. Change the defaults retrieving categories.
* @return array List of categories. * @return array List of categories.
*/ */
function &get_categories( $args = '' ) { function get_categories( $args = '' ) {
$defaults = array( 'taxonomy' => 'category' ); $defaults = array( 'taxonomy' => 'category' );
$args = wp_parse_args( $args, $defaults ); $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. * @param string $filter Optional. Default is raw or no WordPress defined filter will applied.
* @return mixed Category data in type defined by $output parameter. * @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 ); $category = get_term( $category, 'category', $output, $filter );
if ( is_wp_error( $category ) ) if ( is_wp_error( $category ) )
return $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. * @param string|array $args Tag arguments to use when retrieving tags.
* @return array List of tags. * @return array List of tags.
*/ */
function &get_tags( $args = '' ) { function get_tags( $args = '' ) {
$tags = get_terms( 'post_tag', $args ); $tags = get_terms( 'post_tag', $args );
if ( empty( $tags ) ) { 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. * @param string $filter Optional. Default is raw or no WordPress defined filter will applied.
* @return object|array Return type based on $output value. * @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 ); return get_term( $tag, 'post_tag', $output, $filter );
} }

View File

@ -296,7 +296,7 @@ class WP_oEmbed {
* *
* @return WP_oEmbed object. * @return WP_oEmbed object.
*/ */
function &_wp_oembed_get_object() { function _wp_oembed_get_object() {
static $wp_oembed; static $wp_oembed;
if ( is_null($wp_oembed) ) if ( is_null($wp_oembed) )

View File

@ -127,7 +127,7 @@ function get_approved_comments($post_id) {
* @param string $output Optional. OBJECT or ARRAY_A or ARRAY_N constants. * @param string $output Optional. OBJECT or ARRAY_A or ARRAY_N constants.
* @return object|array|null Depends on $output value. * @return object|array|null Depends on $output value.
*/ */
function &get_comment(&$comment, $output = OBJECT) { function get_comment(&$comment, $output = OBJECT) {
global $wpdb; global $wpdb;
$null = null; $null = null;
@ -723,7 +723,7 @@ function check_comment_flood_db( $ip, $email, $date ) {
* @param array $comments Array of comments * @param array $comments Array of comments
* @return array Array of comments keyed by comment_type. * @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()); $comments_by_type = array('comment' => array(), 'trackback' => array(), 'pingback' => array(), 'pings' => array());
$count = count($comments); $count = count($comments);
for ( $i = 0; $i < $count; $i++ ) { for ( $i = 0; $i < $count; $i++ ) {

View File

@ -19,7 +19,7 @@
* *
* @return WP_Http HTTP Transport object. * @return WP_Http HTTP Transport object.
*/ */
function &_wp_http_get_object() { function _wp_http_get_object() {
static $http; static $http;
if ( is_null($http) ) if ( is_null($http) )

View File

@ -493,7 +493,7 @@ function load_child_theme_textdomain( $domain, $path = false ) {
* @param string $domain * @param string $domain
* @return object A Translation instance * @return object A Translation instance
*/ */
function &get_translations_for_domain( $domain ) { function get_translations_for_domain( $domain ) {
global $l10n; global $l10n;
if ( !isset( $l10n[$domain] ) ) { if ( !isset( $l10n[$domain] ) ) {
$l10n[$domain] = new NOOP_Translations; $l10n[$domain] = new NOOP_Translations;

View File

@ -215,7 +215,7 @@ class MO extends Gettext_Translations {
* @param string $translation translation string from MO file. Might contain * @param string $translation translation string from MO file. Might contain
* 0x00 as a plural translations separator * 0x00 as a plural translations separator
*/ */
function &make_entry($original, $translation) { function make_entry($original, $translation) {
$entry = new Translation_Entry(); $entry = new Translation_Entry();
// look for context // look for context
$parts = explode(chr(4), $original); $parts = explode(chr(4), $original);

View File

@ -3370,7 +3370,7 @@ function get_page_by_title($page_title, $output = OBJECT, $post_type = 'page' )
* @param array $pages List of pages' objects. * @param array $pages List of pages' objects.
* @return array * @return array
*/ */
function &get_page_children($page_id, $pages) { function get_page_children($page_id, $pages) {
$page_list = array(); $page_list = array();
foreach ( (array) $pages as $page ) { foreach ( (array) $pages as $page ) {
if ( $page->post_parent == $page_id ) { if ( $page->post_parent == $page_id ) {
@ -3394,7 +3394,7 @@ function &get_page_children($page_id, $pages) {
* @param int $page_id Parent page ID. * @param int $page_id Parent page ID.
* @return array A list arranged by hierarchy. Children immediately follow their parents. * @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 ) ) { if ( empty( $pages ) ) {
$result = array(); $result = array();
return $result; return $result;
@ -3462,7 +3462,7 @@ function get_page_uri($page) {
* @param mixed $args Optional. Array or string of options that overrides defaults. * @param mixed $args Optional. Array or string of options that overrides defaults.
* @return array List of pages matching defaults or $args * @return array List of pages matching defaults or $args
*/ */
function &get_pages($args = '') { function get_pages($args = '') {
global $wpdb; global $wpdb;
$pages = false; $pages = false;
@ -4950,7 +4950,7 @@ function _wp_put_post_revision( $post = null, $autosave = false ) {
* @param string $filter Optional sanitation filter. @see sanitize_post() * @param string $filter Optional sanitation filter. @see sanitize_post()
* @return mixed Null if error or post object if success * @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; $null = null;
if ( !$revision = get_post( $post, OBJECT, $filter ) ) if ( !$revision = get_post( $post, OBJECT, $filter ) )
return $revision; return $revision;

View File

@ -86,7 +86,7 @@ function set_query_var($var, $value) {
* @param string $query * @param string $query
* @return array List of posts * @return array List of posts
*/ */
function &query_posts($query) { function query_posts($query) {
unset($GLOBALS['wp_query']); unset($GLOBALS['wp_query']);
$GLOBALS['wp_query'] = new WP_Query(); $GLOBALS['wp_query'] = new WP_Query();
return $GLOBALS['wp_query']->query($query); return $GLOBALS['wp_query']->query($query);
@ -1916,7 +1916,7 @@ class WP_Query {
* *
* @return array List of posts. * @return array List of posts.
*/ */
function &get_posts() { function get_posts() {
global $wpdb, $user_ID, $_wp_using_ext_object_cache; global $wpdb, $user_ID, $_wp_using_ext_object_cache;
$this->parse_query(); $this->parse_query();
@ -2936,7 +2936,7 @@ class WP_Query {
* @param string $query URL query string. * @param string $query URL query string.
* @return array List of posts. * @return array List of posts.
*/ */
function &query( $query ) { function query( $query ) {
$this->init(); $this->init();
$this->query = $this->query_vars = wp_parse_args( $query ); $this->query = $this->query_vars = wp_parse_args( $query );
return $this->get_posts(); return $this->get_posts();

View File

@ -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 * @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. * 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; global $wpdb;
$null = null; $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 * @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. * @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; global $wpdb;
$empty_array = array(); $empty_array = array();
@ -2637,7 +2637,7 @@ function clean_term_cache($ids, $taxonomy = '', $clean_taxonomy = true) {
* @param string $taxonomy Taxonomy Name * @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. * @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"); $cache = wp_cache_get($id, "{$taxonomy}_relationships");
return $cache; return $cache;
} }
@ -2783,7 +2783,7 @@ function _get_term_hierarchy($taxonomy) {
* @param string $taxonomy The taxonomy which determines the hierarchy of the terms. * @param string $taxonomy The taxonomy which determines the hierarchy of the terms.
* @return array The subset of $terms that are descendants of $term_id. * @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(); $empty_array = array();
if ( empty($terms) ) if ( empty($terms) )
return $empty_array; return $empty_array;