Changeset 1238 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php
- Timestamp:
- 02/10/2015 12:18:47 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php
r1212 r1238 241 241 242 242 foreach ( $api->themes as &$theme ) { 243 $theme->name = wp_kses( $theme->name, $themes_allowedtags ); 244 $theme->author = wp_kses( $theme->author, $themes_allowedtags ); 245 $theme->version = wp_kses( $theme->version, $themes_allowedtags ); 246 $theme->description = wp_kses( $theme->description, $themes_allowedtags ); 247 $theme->num_ratings = number_format_i18n( $theme->num_ratings ); 248 $theme->preview_url = set_url_scheme( $theme->preview_url ); 243 $theme->name = wp_kses( $theme->name, $themes_allowedtags ); 244 $theme->author = wp_kses( $theme->author, $themes_allowedtags ); 245 $theme->version = wp_kses( $theme->version, $themes_allowedtags ); 246 $theme->description = wp_kses( $theme->description, $themes_allowedtags ); 247 $theme->num_ratings = number_format_i18n( $theme->num_ratings ); 248 $theme->preview_url = set_url_scheme( $theme->preview_url ); 249 wporg_themes_photon_screen_shot( $theme ); 249 250 } 250 251 … … 264 265 } 265 266 266 $theme->name = wp_kses( $theme->name, $themes_allowedtags ); 267 $theme->author = wp_kses( $theme->author, $themes_allowedtags ); 268 $theme->version = wp_kses( $theme->version, $themes_allowedtags ); 269 $theme->description = wp_kses( $theme->description, $themes_allowedtags ); 270 $theme->num_ratings = number_format_i18n( $theme->num_ratings ); 271 $theme->preview_url = set_url_scheme( $theme->preview_url ); 267 $theme->name = wp_kses( $theme->name, $themes_allowedtags ); 268 $theme->author = wp_kses( $theme->author, $themes_allowedtags ); 269 $theme->version = wp_kses( $theme->version, $themes_allowedtags ); 270 $theme->description = wp_kses( $theme->description, $themes_allowedtags ); 271 $theme->num_ratings = number_format_i18n( $theme->num_ratings ); 272 $theme->preview_url = set_url_scheme( $theme->preview_url ); 273 wporg_themes_photon_screen_shot( $theme ); 272 274 273 275 wp_send_json_success( $theme ); … … 275 277 add_action( 'wp_ajax_theme-info', 'wporg_themes_theme_info' ); 276 278 add_action( 'wp_ajax_nopriv_theme-info', 'wporg_themes_theme_info' ); 279 280 /** 281 * Photon-ifies the screen shot URL. 282 * 283 * @param object $theme 284 * @return object 285 */ 286 function wporg_themes_photon_screen_shot( $theme ) { 287 if ( preg_match( '/screenshot.(jpg|jpeg|png|gif)/', $theme->screenshot_url, $match ) ) { 288 $theme->screenshot_url = sprintf( 'https://i0.wp.com/themes.svn.wordpress.org/%1$s/%2$s/%3$s', 289 $theme->slug, 290 $theme->version, 291 $match[0] 292 ); 293 } 294 return $theme; 295 } 277 296 278 297 /**
Note: See TracChangeset
for help on using the changeset viewer.