Making WordPress.org

Changeset 2556


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

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

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
Files:
2 added
2 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();
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/plugin-directory.php

    r2501 r2556  
    1414 */
    1515
    16 include_once( 'class-wporg-plugin-directory.php' );
    17 include_once( 'class-wporg-plugin-directory-template.php' );
    18 include_once( 'class-wporg-plugin-directory-tools.php' );
     16include __DIR__ . '/class-wporg-plugin-directory.php';
     17include __DIR__ . '/class-wporg-plugin-directory-template.php';
     18include __DIR__ . '/class-wporg-plugin-directory-tools.php';
     19
     20include __DIR__ . '/shortcodes/screenshots.php';
    1921
    2022$wporg_plugin_directory = new WPorg_Plugin_Directory();
Note: See TracChangeset for help on using the changeset viewer.