Changeset 4560 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin.php
- Timestamp:
- 12/19/2016 07:17:41 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin.php
r4559 r4560 111 111 $result['sections'][ $_pages[ $i ] ] = apply_filters( 'the_content', $_pages[ $i + 1 ], $_pages[ $i ] ); 112 112 } 113 $result['sections']['screenshots'] = ''; // placeholder to put screenshots prior to reviews at the end. 113 114 $result['sections']['reviews'] = $this->get_plugin_reviews_markup( $post->post_name ); 115 114 116 if ( !empty( $result['sections']['faq'] ) ) { 115 $result['sections']['enhanced_faq'] = $result['sections']['faq']; 116 $result['sections']['faq'] = $this->get_simplified_faq_markup( $result['sections']['enhanced_faq'] ); 117 $result['sections']['faq'] = $this->get_simplified_faq_markup( $result['sections']['faq'] ); 117 118 } 118 119 … … 135 136 'caption' => array_key_exists( $image['resolution'], $descriptions ) ? $descriptions[ $image['resolution'] ] : '' 136 137 ); 138 } 139 140 if ( $result['screenshots'] ) { 141 $result['sections']['screenshots'] = $this->get_screenshot_markup( $result['screenshots'] ); 142 } else { 143 unset( $result['sections']['screenshots'] ); 137 144 } 138 145 … … 294 301 } 295 302 303 protected function get_screenshot_markup( $screenshots ) { 304 $markup = '<ol>'; 305 306 foreach ( $screenshots as $shot ) { 307 if ( $shot['caption'] ) { 308 $markup .= sprintf( 309 '<li><a href="%1$s"><img src="%1$s" alt="%2$s"></a><p>%3$s</p></li>', 310 esc_attr( $shot['src'] ), 311 esc_attr( $shot['caption'] ), 312 $shot['caption'] 313 ); 314 } else { 315 $markup .= sprintf( 316 '<li><a href="%1$s"><img src="%1$s" alt=""></a></li>', 317 esc_attr( $shot['src'] ) 318 ); 319 } 320 } 321 322 $markup .= '</ol>'; 323 return $markup; 324 } 325 296 326 } 297 327
Note: See TracChangeset
for help on using the changeset viewer.