WordPress.org

Making WordPress.org

Changeset 3436


Ignore:
Timestamp:
06/18/2016 02:02:06 PM (5 years ago)
Author:
obenland
Message:

Plugin Directory: Avoid undefined index notice when getting section content.

See #1719.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php

    r3431 r3436  
    4747
    4848            foreach ( array( 'description', 'screenshots', 'faq', 'reviews', 'changelog', 'developers' ) as $section_slug ) :
     49                if ( ! array_key_exists( $section_slug, $content ) || in_array( $section_slug, array( 'installation', 'other_notes' ) ) ) :
     50                    continue;
     51                endif;
     52
    4953                $section_content = trim( apply_filters( 'the_content', $content[ $section_slug ], $section_slug ) );
    50 
    51                 if ( ! array_key_exists( $section_slug, $content ) || in_array( $section_slug, array( 'installation', 'other_notes' ) ) || empty( $section_content ) ) :
     54                if ( empty( $section_content ) ) :
    5255                    continue;
    5356                endif;
Note: See TracChangeset for help on using the changeset viewer.