Changeset 6475
- Timestamp:
- 01/30/2018 10:13:50 PM (7 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php
r6474 r6475 68 68 69 69 if ( is_singular( 'plugin' ) ) { 70 wp_enqueue_script( 'wporg-plugins-accordion', get_template_directory_uri() . '/js/section-accordion.js', array(), '20161121', true );71 70 wp_enqueue_script( 'wporg-plugins-faq', get_template_directory_uri() . '/js/section-faq.js', array(), '20171218', true ); 72 71 } … … 141 140 'wporg-plugins-locale-banner', 142 141 'wporg-plugins-stats', 143 'wporg-plugins-accordion',144 142 'wporg-plugins-client', 145 143 'wporg-plugins-faq', -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php
r6469 r6475 13 13 use WordPressdotorg\Plugin_Directory\Template; 14 14 15 global $section, $section_slug, $section_content, $ section_read_more, $post;15 global $section, $section_slug, $section_content, $post; 16 16 17 17 $content = Plugin_Directory::instance()->split_post_content_into_pages( get_the_content() ); … … 100 100 $section = array_pop( $section ); 101 101 102 $section_no_read_mores = array( 'description', 'screenshots', 'installation', 'faq', 'reviews' );103 // If the FAQ section is the newer `<dl>` form, no need to do read-more for it.104 if ( false !== stripos( $section_content, '<dl>' ) ) {105 $section_no_read_mores[] = 'faq';106 }107 108 $section_read_more = ! in_array( $section_slug, $section_no_read_mores, true );109 110 102 get_template_part( 'template-parts/section' ); 111 103 endforeach; -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/section.php
r6296 r6475 8 8 */ 9 9 10 global $section, $section_slug, $section_content , $section_read_more;10 global $section, $section_slug, $section_content; 11 11 12 12 $prefix = in_array( $section_slug, array( 'screenshots', 'faq' ), true ) ? '' : 'tab-'; 13 13 14 14 $classes = [ 'plugin-' . $section_slug, 'section' ]; 15 if ( $section_read_more ) {16 $classes[] = 'read-more';17 }18 15 $classes = implode( ' ', $classes ); 19 16 ?> … … 23 20 <?php echo $section_content; ?> 24 21 </div> 25 <?php if ( $section_read_more ) : ?>26 <button27 type="button"28 class="button-link section-toggle"29 aria-controls="<?php echo esc_attr( $prefix . $section_slug ); ?>"30 aria-describedby="<?php echo esc_attr( $section_slug . '-header' ); ?>"31 aria-expanded="false"32 data-show-less="<?php esc_attr_e( 'Show less', 'wporg-plugins' ); ?>"33 data-read-more="<?php esc_attr_e( 'Read more', 'wporg-plugins' ); ?>"34 >35 <?php esc_html_e( 'Read more', 'wporg-plugins' ); ?>36 </button>37 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.