Skip to content

Commit

Permalink
Remove unnecessary return by refs. Props wonderboymusic. fixes #21839
Browse files Browse the repository at this point in the history
git-svn-id: http://core.svn.wordpress.org/trunk@21792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
Ryan Boren committed Sep 10, 2012
1 parent daa6757 commit f483a85
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions wp-includes/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 ) ) {
Expand Down Expand Up @@ -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 );
}

Expand Down
2 changes: 1 addition & 1 deletion wp-includes/class-oembed.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ function _strip_newlines( $html, $data, $url ) {
*
* @return WP_oEmbed object.
*/
function &_wp_oembed_get_object() {
function _wp_oembed_get_object() {
static $wp_oembed;

if ( is_null($wp_oembed) )
Expand Down
4 changes: 2 additions & 2 deletions wp-includes/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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++ ) {
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/http.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) )
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/l10n.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/pomo/mo.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function import_from_reader($reader) {
* @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);
Expand Down
8 changes: 4 additions & 4 deletions wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions wp-includes/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -1916,7 +1916,7 @@ function set($query_var, $value) {
*
* @return array List of posts.
*/
function &get_posts() {
function get_posts() {
global $wpdb, $user_ID, $_wp_using_ext_object_cache;

$this->parse_query();
Expand Down Expand Up @@ -2936,7 +2936,7 @@ function rewind_comments() {
* @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();
Expand Down
8 changes: 4 additions & 4 deletions wp-includes/taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ private function transform_query( &$query, $resulting_field ) {
* @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;

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f483a85

Please sign in to comment.