Making WordPress.org

Changeset 10302


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

BuddyPress Codex: Apply r10301 here too; 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-buddypress-org/page.php

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