Changeset 1321
- Timestamp:
- 02/25/2015 03:23:28 PM (10 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-repo-package.php
r1315 r1321 14 14 * @return string 15 15 */ 16 public function screen _shot_url() {16 public function screenshot_url() { 17 17 $screen = 'screenshot.png'; 18 18 $version = $this->latest_version(); 19 19 20 if ( ! empty( $this->wp_post->_screen _shot[ $version ] ) ) {21 $screen = $this->wp_post->_screen _shot[ $version ];20 if ( ! empty( $this->wp_post->_screenshot[ $version ] ) ) { 21 $screen = $this->wp_post->_screenshot[ $version ]; 22 22 } 23 23 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php
r1315 r1321 112 112 113 113 // We need a screen shot. People love screen shots. 114 if ( ! $this->has_screen _shot( $theme_files ) ) {114 if ( ! $this->has_screenshot( $theme_files ) ) { 115 115 return sprintf( __( 'The zip file must include a file named %1$s or %2$s.', 'wporg-themes' ), '<code>screenshot.png</code>', '<code>screenshot.jpg</code>' ); 116 116 } … … 302 302 * @return bool 303 303 */ 304 public function has_screen _shot( $theme_files ) {305 $screen _shots = preg_grep( '/screenshot.(jpg|jpeg|png|gif)/', $theme_files );306 usort( $screen _shots, array( $this, 'sort_by_string_length' ) );307 308 $this->theme->screen _shot = array_pop( $screen_shots );309 310 return (bool) $this->theme->screen _shot;304 public function has_screenshot( $theme_files ) { 305 $screenshots = preg_grep( '/screenshot.(jpg|jpeg|png|gif)/', $theme_files ); 306 usort( $screenshots, array( $this, 'sort_by_string_length' ) ); 307 308 $this->theme->screenshot = array_pop( $screenshots ); 309 310 return (bool) $this->theme->screenshot; 311 311 } 312 312 … … 452 452 [[TicketQuery(format=table, keywords=~theme-{$this->theme->get_stylesheet()}, col=id|summary|status|resolution|owner)]] 453 453 454 [[Image(https://themes.svn.wordpress.org/{$this->theme->get_stylesheet()}/{$this->theme->display( 'Version' )}/{$this->theme->screen _shot}, width=640)]]454 [[Image(https://themes.svn.wordpress.org/{$this->theme->get_stylesheet()}/{$this->theme->display( 'Version' )}/{$this->theme->screenshot}, width=640)]] 455 455 TICKET; 456 456 } … … 535 535 '_upload_date' => $upload_date, 536 536 '_ticket_id' => $ticket_id, 537 '_screen _shot' => $this->theme->screen_shot,537 '_screenshot' => $this->theme->screenshot, 538 538 ); 539 539 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
r1320 r1321 271 271 if ( 'repopackage' == $post->post_type ) { 272 272 $theme = new WPORG_Themes_Repo_Package( $post ); 273 $src = add_query_arg( array( 'w' => $size, 'strip' => 'all' ), $theme->screen _shot_url() );273 $src = add_query_arg( array( 'w' => $size, 'strip' => 'all' ), $theme->screenshot_url() ); 274 274 275 275 $html = '<img src="' . esc_url( $src ) . '"/>';
Note: See TracChangeset
for help on using the changeset viewer.