Changeset 3401
- Timestamp:
- 06/17/2016 09:11:50 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-screenshots.php
r2621 r3401 1 1 <?php 2 2 namespace WordPressdotorg\Plugin_Directory\Shortcodes; 3 4 3 use WordPressdotorg\Plugin_Directory\Template; 5 4 … … 19 18 20 19 // All indexed from 1. 21 $ screenshot_descriptions = get_post_meta( $plugin->ID, 'screenshots', true );22 $ assets_screenshots= get_post_meta( $plugin->ID, 'assets_screenshots', true );20 $descriptions = get_post_meta( $plugin->ID, 'screenshots', true ); 21 $screen_shots = get_post_meta( $plugin->ID, 'assets_screenshots', true ); 23 22 24 foreach ( $screenshot_descriptions as $index => $description ) { 23 /* 24 * Find the image that corresponds with the text. 25 * The image numbers are stored within the 'resolution' key. 26 */ 27 foreach ( $screen_shots as $image ) { 28 $screen_shot = sprintf( '<a href="%1$s" rel="nofollow"><img class="screenshot" src="%1$s" /></a>', 29 Template::get_asset_url( $plugin->post_name, $image ) 30 ); 25 31 26 /* 27 * Find the image that corresponds with the text. 28 * The image numbers are stored within the 'resolution' key. 29 */ 30 foreach ( $assets_screenshots as $image ) { 31 if ( $index == $image['resolution'] ) { 32 $output .= sprintf( 33 '<li> 34 <a href="%1$s" rel="nofollow"> 35 <img class="screenshot" src="%1$s"> 36 </a> 37 <p>%2$s</p> 38 </li>', 39 Template::get_asset_url( $plugin->post_name, $image ), 40 $description 41 ); 42 break; 43 } 32 if ( array_key_exists( $image['resolution'], $descriptions ) ) { 33 $screen_shot .= '<figcaption>' . esc_html( $descriptions[ $image['resolution'] ] ) . '</figcaption>'; 44 34 } 35 36 $output .= '<li><figure>' . $screen_shot . '</figure></li>'; 45 37 } 46 38 47 return '< ol class="screenshots">' . $output . '</ol>';39 return '<ul class="plugin-screenshots">' . $output . '</ul>'; 48 40 } 49 41 }
Note: See TracChangeset
for help on using the changeset viewer.