Making WordPress.org


Ignore:
Timestamp:
08/18/2016 01:17:38 AM (8 years ago)
Author:
obenland
Message:

Plugin Directory: Accordion view for plugin FAQs

Includes a refactoring of plugin sections to be more modular.

See #1810.

File:
1 edited

Legend:

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

    r3791 r3825  
    1212use WordPressdotorg\Plugin_Directory\Template;
    1313use WordPressdotorg\Plugin_Directory\Tools;
     14global $section, $section_slug, $section_content;
    1415
    1516$content = Plugin_Directory::instance()->split_post_content_into_pages( get_the_content() );
     
    7980                $section = wp_list_filter( $plugin_sections, array( 'slug' => $section_slug ) );
    8081                $section = array_pop( $section );
     82
     83                get_template_part( 'template-parts/section', $section_slug );
     84            endforeach;
    8185        ?>
    82 
    83             <div id="<?php echo esc_attr( $section_slug ); ?>" class="read-more" aria-expanded="false">
    84                 <h2><?php echo $section['title']; ?></h2>
    85                 <?php echo $section_content; ?>
    86             </div>
    87                 <?php if ( 'reviews' === $section_slug ) : ?>
    88                 <a class="reviews-link" href="<?php echo esc_url( 'https://wordpress.org/support/view/plugin-reviews/' . get_post()->post_name . '/' ); ?>">
    89                     <?php printf( __( 'Read all %s reviews', 'wporg-plugins' ), array_sum( get_post_meta( get_the_ID(), 'ratings', true ) ) ); ?>
    90                 </a>
    91                 <?php else : ?>
    92             <button type="button" class="button-link section-toggle" aria-controls="<?php echo esc_attr( $section_slug ); ?>"><?php _e( 'Read more', 'wporg-plugins' ); ?></button>
    93                 <?php endif; ?>
    94         <?php endforeach; ?>
    9586    </div><!-- .entry-content -->
    9687
Note: See TracChangeset for help on using the changeset viewer.