Making WordPress.org

Changeset 10301


Ignore:
Timestamp:
09/29/2020 03:02:54 AM (6 years ago)
Author:
dd32
Message:

bbPress Codex: Avoid a PHP Notice when determining the number of contributors to a given page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/buddypress.org/public_html/wp-content/themes/codex-bbpress-org/page.php

    r442 r10301  
    2727        $post_authors = array( $post->post_author => 1 );
    2828        foreach( (array)$revisions as $revision ) {
    29                 $post_authors[$revision->post_author] += 1;
     29                if ( isset( $post_authors[ $revision->post_author ] ) ) {
     30                        $post_authors[ $revision->post_author ]++;
     31                } else {
     32                        $post_authors[ $revision->post_author ] = 1;
     33                }
    3034        }
    3135        asort( $post_authors, SORT_NUMERIC );
Note: See TracChangeset for help on using the changeset viewer.