Skip to:
Content

bbPress.org

Changeset 6684


Ignore:
Timestamp:
09/09/2017 02:43:03 PM (9 years ago)
Author:
johnjamesjacoby
Message:

General: more PHP7.1 array fixes.

See #3031. 2.5 branch, for 2.5.14.

Location:
branches/2.5/includes
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/includes/common/template.php

    r5698 r6684  
    18201820function bbp_get_tiny_mce_plugins( $plugins = array() ) {
    18211821
     1822        $plugins = (array) $plugins;
     1823
    18221824        // Unset fullscreen
    18231825        foreach ( $plugins as $key => $value ) {
  • branches/2.5/includes/forums/functions.php

    r6647 r6684  
    18491849
    18501850                // Get any existing meta queries
    1851                 $meta_query   = $posts_query->get( 'meta_query', array() );
     1851                $meta_query   = (array) $posts_query->get( 'meta_query', array() );
    18521852
    18531853                // Add our meta query to existing
  • branches/2.5/includes/replies/template.php

    r5692 r6684  
    12351235                        if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_reply_author_id( $reply_id ) ) ) {
    12361236
     1237                                $author_link = array();
     1238
    12371239                                // Assemble the links
    12381240                                foreach ( $author_links as $link => $link_text ) {
  • branches/2.5/includes/topics/template.php

    r5693 r6684  
    15061506                        if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_topic_author_id( $topic_id ) ) ) {
    15071507
     1508                                $author_link = array();
     1509
    15081510                                // Assemble the links
    15091511                                foreach ( $author_links as $link => $link_text ) {
     
    38033805                        }
    38043806
     3807                        $new_terms = array();
     3808
    38053809                        // Topic exists
    38063810                        if ( !empty( $topic_id ) ) {
     
    38083812                                // Topic is spammed so display pre-spam terms
    38093813                                if ( bbp_is_topic_spam( $topic_id ) ) {
    3810 
    3811                                         // Get pre-spam terms
    38123814                                        $new_terms = get_post_meta( $topic_id, '_bbp_spam_topic_tags', true );
    3813 
    3814                                         // If terms exist, explode them and compile the return value
    3815                                         if ( empty( $new_terms ) ) {
    3816                                                 $new_terms = '';
    3817                                         }
    38183815
    38193816                                // Topic is not spam so get real terms
    38203817                                } else {
    3821                                         $terms = array_filter( (array) get_the_terms( $topic_id, bbp_get_topic_tag_tax_id() ) );
    3822 
    3823                                         // Loop through them
    3824                                         foreach ( $terms as $term ) {
    3825                                                 $new_terms[] = $term->name;
    3826                                         }
     3818                                        $terms     = array_filter( (array) get_the_terms( $topic_id, bbp_get_topic_tag_tax_id() ) );
     3819                                        $new_terms = wp_list_pluck( $terms, 'name' );
    38273820                                }
    3828 
    3829                         // Define local variable(s)
    3830                         } else {
    3831                                 $new_terms = '';
    38323821                        }
    38333822
  • branches/2.5/includes/users/template.php

    r6647 r6684  
    16751675                        if ( empty( $anonymous ) && bbp_user_has_profile( $user_id ) ) {
    16761676                                $author_url = bbp_get_user_profile_url( $user_id );
     1677                                $author_link = array();
    16771678                                foreach ( $author_links as $link_text ) {
    16781679                                        $author_link[] = sprintf( '<a href="%1$s"%2$s>%3$s</a>', esc_url( $author_url ), $link_title, $link_text );
Note: See TracChangeset for help on using the changeset viewer.