Changeset 3019
- Timestamp:
- 04/27/2016 07:51:54 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php
r3008 r3019 72 72 $assets = $data['assets']; 73 73 $headers = $data['plugin_headers']; 74 $tagged_versions = $data['tagged_versions']; 74 75 75 76 $content = ''; … … 101 102 } 102 103 103 update_post_meta( $plugin->ID, 'sections', array_keys( $readme->sections ) ); 104 update_post_meta( $plugin->ID, 'assets_screenshots', $assets['screenshot'] ); 105 update_post_meta( $plugin->ID, 'assets_icons', $assets['icon'] ); 106 update_post_meta( $plugin->ID, 'assets_banners', $assets['banner'] ); 104 update_post_meta( $plugin->ID, 'tagged_versions', wp_slash( $tagged_versions ) ); 105 update_post_meta( $plugin->ID, 'sections', wp_slash( array_keys( $readme->sections ) ) ); 106 update_post_meta( $plugin->ID, 'assets_screenshots', wp_slash( $assets['screenshot'] ) ); 107 update_post_meta( $plugin->ID, 'assets_icons', wp_slash( $assets['icon'] ) ); 108 update_post_meta( $plugin->ID, 'assets_banners', wp_slash( $assets['banner'] ) ); 107 109 108 110 // Calculate the 'plugin color' from the average color of the banner if provided. This is used for fallback icons. … … 112 114 $banner_average_color = Tools::get_image_average_color( Template::get_asset_url( $plugin_slug, $first_banner ) ); 113 115 } 114 update_post_meta( $plugin->ID, 'assets_banners_color', $banner_average_color);116 update_post_meta( $plugin->ID, 'assets_banners_color', wp_slash( $banner_average_color ) ); 115 117 116 118 } … … 189 191 } 190 192 193 $tagged_versions = SVN::ls( "https://plugins.svn.wordpress.org/{$plugin_slug}/tags/" ); 194 $tagged_versions = array_map( function( $item ) { 195 return rtrim( $item, '/' ); 196 }, $tagged_versions ); 197 191 198 // Find screenshots in the stable plugin folder (but don't overwrite /assets/) 192 199 foreach ( Filesystem::list_files( "$tmp_dir/$stable/", false /* non-recursive */, '!^screenshot-\d+\.(jpeg|jpg|png|gif)$!' ) as $plugin_screenshot ) { … … 208 215 } 209 216 210 return compact( 'readme', 'trunk_readme', 'tmp_dir', 'plugin_headers', 'assets' );217 return compact( 'readme', 'trunk_readme', 'tmp_dir', 'plugin_headers', 'assets', 'tagged_versions' ); 211 218 } 212 219
Note: See TracChangeset
for help on using the changeset viewer.