WordPress.org

Making WordPress.org

Changeset 3411


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

Plugin Directory: Order content parts as they are in mockup.

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

    r3405 r3411  
    4444    <div class="entry-content">
    4545        <?php
    46             foreach ( Template::get_plugin_sections() as $section ) :
    47                 if ( ! array_key_exists( $section['slug'], $content ) || in_array( $section['slug'], array( 'installation', 'other_notes' ) ) ) :
     46            $plugin_sections = Template::get_plugin_sections();
     47            foreach ( array( 'description', 'screenshots', 'faq', 'reviews' ) as $section_slug ) :
     48                if ( ! array_key_exists( $section_slug, $content ) || in_array( $section_slug, array( 'installation', 'other_notes' ) ) ) :
    4849                    continue;
    4950                endif;
     51                $section = wp_list_filter( $plugin_sections, array( 'slug' => $section_slug ) );
     52                $section = array_pop( $section );
    5053        ?>
    5154
    52             <div id="<?php echo esc_attr( $section['slug'] ); ?>" class="read-more" aria-expanded="false">
     55            <div id="<?php echo esc_attr( $section_slug ); ?>" class="read-more" aria-expanded="false">
    5356                <h2><?php echo $section['title']; ?></h2>
    54                 <?php echo apply_filters( 'the_content', $content[ $section['slug'] ], $section['slug'] ); ?>
     57                <?php echo apply_filters( 'the_content', $content[ $section_slug ], $section_slug ); ?>
    5558            </div>
    56             <button type="button" class="button-link section-toggle" aria-controls="<?php echo esc_attr( $section['slug'] ); ?>"><?php _e( 'Read more', 'wporg-plugins' ); ?></button>
     59            <button type="button" class="button-link section-toggle" aria-controls="<?php echo esc_attr( $section_slug ); ?>"><?php _e( 'Read more', 'wporg-plugins' ); ?></button>
    5760        <?php endforeach; ?>
    5861    </div><!-- .entry-content -->
     
    6467            the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Meta',    array(), $widget_args );
    6568        ?>
    66 
    6769    </div><!-- .entry-meta -->
    6870</article><!-- #post-## -->
Note: See TracChangeset for help on using the changeset viewer.