Changeset 4560
- Timestamp:
- 12/19/2016 07:17:41 AM (8 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 3 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 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/standalone/class-plugins-info-api-request.php
r4559 r4560 48 48 'tags' => true, 49 49 'tested' => true, 50 'enhanced_faq' => false,51 50 ); 52 51 … … 67 66 'tags' => true, 68 67 'tested' => true, 69 'enhanced_faq' => false,70 68 ); 71 69 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/standalone/class-plugins-info-api.php
r4559 r4560 112 112 if ( 'reviews' === $field && ! $include ) { 113 113 unset( $response['sections']['reviews'] ); 114 }115 if ( 'enhanced_faq' === $field ) {116 if ( $include ) {117 $response['sections']['faq'] = $response['sections']['enhanced_faq'];118 }119 unset( $response['sections']['enhanced_faq'] );120 114 } 121 115 } … … 213 207 */ 214 208 protected function popular_tags_cache_key( $request ) { 215 return 'hot_tags:' . $request->locale; ;209 return 'hot_tags:' . $request->locale; 216 210 } 217 211
Note: See TracChangeset
for help on using the changeset viewer.