Make WordPress Core


Ignore:
Timestamp:
08/25/2015 08:27:56 PM (11 years ago)
Author:
wonderboymusic
Message:

foreach is a statement, not a function.

See #33491.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r33723 r33734  
    24652465
    24662466        $counts = array();
    2467         foreach( (array) $count as $row ) {
     2467        foreach ( (array) $count as $row ) {
    24682468                $counts[ $row['post_mime_type'] ] = $row['num_posts'];
    24692469        }
    … …  
    30803080        // Backward compatibility. Prior to 3.1 expected posts to be returned in array.
    30813081        if ( ARRAY_A == $output ){
    3082                 foreach( $results as $key => $result ) {
     3082                foreach ( $results as $key => $result ) {
    30833083                        $results[$key] = get_object_vars( $result );
    30843084                }
    … …  
    33993399        $emoji_fields = array( 'post_title', 'post_content', 'post_excerpt' );
    34003400
    3401         foreach( $emoji_fields as $emoji_field ) {
     3401        foreach ( $emoji_fields as $emoji_field ) {
    34023402                if ( isset( $data[ $emoji_field ] ) ) {
    34033403                        $charset = $wpdb->get_col_charset( $wpdb->posts, $emoji_field );
    … …  
    41504150                if ( 'enclosure' != $key || !is_array( $val ) )
    41514151                        continue;
    4152                 foreach( $val as $enc ) {
     4152                foreach ( $val as $enc ) {
    41534153                        $enclosure = explode( "\n", $enc );
    41544154                        $pung[] = trim( $enclosure[ 0 ] );
    … …  
    42404240
    42414241                $trackback_urls = explode( ',', $tb_list );
    4242                 foreach( (array) $trackback_urls as $tb_url ) {
     4242                foreach ( (array) $trackback_urls as $tb_url ) {
    42434243                        $tb_url = trim( $tb_url );
    42444244                        trackback( $tb_url, wp_unslash( $postdata['post_title'] ), $excerpt, $post_id );
    … …  
    44864486function _page_traverse_name( $page_id, &$children, &$result ){
    44874487        if ( isset( $children[ $page_id ] ) ){
    4488                 foreach( (array)$children[ $page_id ] as $child ) {
     4488                foreach ( (array)$children[ $page_id ] as $child ) {
    44894489                        $result[ $child->ID ] = $child->post_name;
    44904490                        _page_traverse_name( $child->ID, $children, $result );
    … …  
    47754775        if ( ! empty( $r['exclude_tree'] ) ) {
    47764776                $exclude = wp_parse_id_list( $r['exclude_tree'] );
    4777                 foreach( $exclude as $id ) {
     4777                foreach ( $exclude as $id ) {
    47784778                        $children = get_page_children( $id, $pages );
    47794779                        foreach ( $children as $child ) {
Note: See TracChangeset for help on using the changeset viewer.