Changeset 4410 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php
- Timestamp:
- 11/24/2016 01:38:06 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php
r4335 r4410 12 12 use WordPressdotorg\Plugin_Directory\Template; 13 13 use WordPressdotorg\Plugin_Directory\Tools; 14 global $section, $section_slug, $section_content ;14 global $section, $section_slug, $section_content, $section_read_more; 15 15 16 16 $content = Plugin_Directory::instance()->split_post_content_into_pages( get_the_content() ); … … 114 114 <?php 115 115 if ( get_query_var( 'plugin_admin' ) ) : 116 get_template_part( 'template-parts/section ', 'admin' );116 get_template_part( 'template-parts/section-admin' ); 117 117 else: 118 118 $plugin_sections = Template::get_plugin_sections(); 119 119 120 120 foreach ( array( 'description', 'screenshots', 'faq', 'reviews', 'changelog', 'developers' ) as $section_slug ) : 121 if ( ! array_key_exists( $section_slug, $content ) || in_array( $section_slug, array( 'installation', 'other_notes' ) ) ) :121 if ( ! isset( $content[ $section_slug ] ) ) { 122 122 continue; 123 endif;123 } 124 124 125 125 $section_content = trim( apply_filters( 'the_content', $content[ $section_slug ], $section_slug ) ); 126 if ( empty( $section_content ) ) :126 if ( empty( $section_content ) ) { 127 127 continue; 128 endif;128 } 129 129 130 130 $section = wp_list_filter( $plugin_sections, array( 'slug' => $section_slug ) ); 131 131 $section = array_pop( $section ); 132 132 133 get_template_part( 'template-parts/section', $section_slug ); 133 $section_no_read_mores = array( 'screenshots', 'reviews' ); 134 // If the FAQ section is the newer `<dl>` form, no need to do read-more for it. 135 if ( false !== stripos( $section_content, '<dl>' ) ) { 136 $section_no_read_mores[] = 'faq'; 137 } 138 139 $section_read_more = ! in_array( $section_slug, $section_no_read_mores ); 140 141 get_template_part( 'template-parts/section' ); 134 142 endforeach; 135 143 endif; // plugin_admin
Note: See TracChangeset
for help on using the changeset viewer.