Making WordPress.org


Ignore:
Timestamp:
02/23/2016 06:06:43 AM (10 years ago)
Author:
dd32
Message:

Plugins Directory: Add a basic screenshots shortcode.
See #1584

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-wporg-plugin-directory-template.php

    r2555 r2556  
    5555        $plugin       = get_post();
    5656        $plugin_slug  = $plugin->post_name;
    57         $raw_sections = get_post_meta( $plugin->ID, 'sections', true );
    58         $raw_sections = array_unique( array_merge( $raw_sections, array(
     57
     58        $default_sections = array(
    5959            'description',
    6060            'screenshots',
     
    6363            'reviews',
    6464            'developers',
    65         ) ) );
     65        );
     66        if ( ! get_post_meta( $plugin->ID, 'screenshots', true ) && ! get_post_meta( $plugin->ID, 'assets_screenshots', true ) ) {
     67            unset( $default_sections[ array_search( 'screenshots', $default_sections ) ] );
     68        }
     69
     70        $raw_sections = get_post_meta( $plugin->ID, 'sections', true );
     71        $raw_sections = array_unique( array_merge( $raw_sections, $default_sections ) );
    6672
    6773        $sections  = array();
Note: See TracChangeset for help on using the changeset viewer.