Making WordPress.org


Ignore:
Timestamp:
02/17/2015 11:18:19 PM (9 years ago)
Author:
obenland
Message:

WP.org Themes: Use main query instead of Themes API for server output.

  • Can now deal properly with /browse/*/ URL structure.
  • Adds single theme navigation.
  • Adds Photon support for server output.
  • Brings single theme view closer to melchoyce's mockups.

See #745.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-repo-package.php

    r1219 r1274  
    1010
    1111    /**
    12      * Returns the screenshot URL for a theme.
     12     * Returns the screen shot URL for a theme.
    1313     *
    1414     * @return string
    1515     */
    16     public function screenshot_url() {
    17         $screen = $this->wp_post->_screenshot;
    18         if ( ! $screen ) {
    19             $screen = sprintf( '//ts.w.org/wp-content/themes/%1$s/screenshot.png?ver=%2$s', $this->wp_post->post_name, $this->latest_version() );
     16    public function screen_shot_url() {
     17        $screen  = 'screenshot.png';
     18        $version = $this->latest_version();
     19
     20        if ( ! empty( $this->wp_post->_screen_shot[ $version ] ) ) {
     21            $screen = $this->wp_post->_screen_shot[ $version ];
    2022        }
    2123
    22         return $screen;
     24        return sprintf( 'https://i0.wp.com/themes.svn.wordpress.org/%1$s/%2$s/%3$s',
     25            $this->wp_post->post_name,
     26            $version,
     27            $screen
     28        );
    2329    }
    2430
Note: See TracChangeset for help on using the changeset viewer.