<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[1274] sites/trunk/wordpress.org/public_html/wp-content: WP.org Themes: Use main query instead of Themes API for server output.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/1274">1274</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/1274","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>obenland</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-02-17 23:18:19 +0000 (Tue, 17 Feb 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>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 <a href="http://meta.trac.wordpress.org/ticket/745">#745</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsthemedirectoryclasswporgthemesrepopackagephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-repo-package.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsthemedirectoryclasswporgthemesuploadphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsthemedirectorythemedirectoryphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemescontentsinglephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemescontentphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesfunctionsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesindexphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesstylecss">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/style.css</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsthemedirectoryclasswporgthemesrepopackagephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-repo-package.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-repo-package.php 2015-02-17 22:51:44 UTC (rev 1273)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-repo-package.php 2015-02-17 23:18:19 UTC (rev 1274)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,17 +9,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class WPORG_Themes_Repo_Package extends Repo_Package {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Returns the screenshot URL for a theme.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Returns the screen shot URL for a theme.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function screenshot_url() {
- $screen = $this->wp_post->_screenshot;
- if ( ! $screen ) {
- $screen = sprintf( '//ts.w.org/wp-content/themes/%1$s/screenshot.png?ver=%2$s', $this->wp_post->post_name, $this->latest_version() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function screen_shot_url() {
+ $screen = 'screenshot.png';
+ $version = $this->latest_version();
+
+ if ( ! empty( $this->wp_post->_screen_shot[ $version ] ) ) {
+ $screen = $this->wp_post->_screen_shot[ $version ];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $screen;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return sprintf( 'https://i0.wp.com/themes.svn.wordpress.org/%1$s/%2$s/%3$s',
+ $this->wp_post->post_name,
+ $version,
+ $screen
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsthemedirectoryclasswporgthemesuploadphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php 2015-02-17 22:51:44 UTC (rev 1273)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php 2015-02-17 23:18:19 UTC (rev 1274)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -301,10 +301,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $screen_shots = preg_grep( '/screenshot.(jpg|jpeg|png|gif)/', $theme_files );
</span><span class="cx" style="display: block; padding: 0 10px"> usort( $screen_shots, array( $this, 'sort_by_string_length' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $screen_shot = array_pop( $screen_shots );
- $this->theme->screen_shot_ext = pathinfo( $screen_shot, PATHINFO_EXTENSION );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->theme->screen_shot = array_pop( $screen_shots );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return (bool) $screen_shot;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (bool) $this->theme->screen_shot;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -448,7 +447,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> History:
</span><span class="cx" style="display: block; padding: 0 10px"> [[TicketQuery(format=table, keywords=~theme-{$this->theme->get_stylesheet()}, col=id|summary|status|resolution|owner)]]
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-[[Image(https://themes.svn.wordpress.org/{$this->theme->get_stylesheet()}/{$this->theme->display( 'Version' )}/screenshot.{$this->theme->screen_shot_ext}, width=640)]]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+[[Image(https://themes.svn.wordpress.org/{$this->theme->get_stylesheet()}/{$this->theme->display( 'Version' )}/{$this->theme->screen_shot}, width=640)]]
</ins><span class="cx" style="display: block; padding: 0 10px"> TICKET;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -531,6 +530,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '_status' => 'new',
</span><span class="cx" style="display: block; padding: 0 10px"> '_upload_date' => $upload_date,
</span><span class="cx" style="display: block; padding: 0 10px"> '_ticket_id' => $ticket_id,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ '_screen_shot' => $this->theme->screen_shot,
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $post_meta as $meta_key => $meta_value ) {
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsthemedirectorythemedirectoryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php 2015-02-17 22:51:44 UTC (rev 1273)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php 2015-02-17 23:18:19 UTC (rev 1274)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,6 +20,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Load uploader.
</span><span class="cx" style="display: block; padding: 0 10px"> include_once plugin_dir_path( __FILE__ ) . 'upload.php';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+register_activation_hook( __FILE__, 'flush_rewrite_rules' );
+register_deactivation_hook( __FILE__, 'flush_rewrite_rules' );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Initialize.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'has_archive' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'query_var' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'can_export' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'rewrite' => true,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'rewrite' => array( 'slug' => '/' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'capability_type' => 'post',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,10 +67,81 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! post_type_exists( 'repopackage' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> register_post_type( 'repopackage', $args );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ add_rewrite_tag( '%browse%', '(featured|popular|new)' );
+
+ // Single themes.
+ add_rewrite_rule( '(.?.+?)(/[0-9]+)?/?$', 'index.php?post_type=repopackage&name=$matches[1]', 'top' );
+
+ // Browse views.
+ add_rewrite_rule( 'browse/(featured|popular|new)/?$', 'index.php?post_type=repopackage&browse=$matches[1]', 'top' );
+
+ // Paginated browse views.
+ add_rewrite_rule( 'browse/(featured|popular|new)/page/?([0-9]{1,})/?$', 'index.php?post_type=repopackage&browse=$matches[1]&paged=$matches[2]', 'top' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'init', 'wporg_themes_init' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Adjusts query to account for custom views.
+ *
+ * @param WP_Query $wp_query
+ * @return WP_Query
+ */
+function wporg_themes_set_up_query( $wp_query ) {
+ if ( is_admin() || in_array( $wp_query->get( 'pagename' ), array( 'upload', 'commercial' ) ) || 'nav_menu_item' == $wp_query->get( 'post_type' ) ) {
+ return $wp_query;
+ }
+
+ $wp_query->set( 'post_type', 'repopackage' );
+
+ if ( $wp_query->is_home() ) {
+ $wp_query->set( 'browse', 'featured' );
+ }
+
+ if ( $wp_query->get( 'browse' ) ) {
+ switch ( $wp_query->get( 'browse' ) ) {
+ case 'featured':
+ $wp_query->set( 'paged', 1 );
+ $wp_query->set( 'posts_per_page', 15 );
+ $wp_query->set( 'date_query', array(
+ array(
+ 'column' => 'post_modified_gmt',
+ 'after' => '-1 year',
+ ),
+ ) );
+ $wp_query->set( 'orderby', 'rand' );
+ break;
+
+ case 'popular':
+ //TODO: Sort by popularity.
+ break;
+
+ case 'new':
+ break;
+ }
+ }
+
+ return $wp_query;
+}
+add_filter( 'pre_get_posts', 'wporg_themes_set_up_query' );
+
+/**
+ * Adjusts the amount of found posts when browsing featured themes.
+ *
+ * @param string $found_posts
+ * @param WP_Query $wp_query
+ * @return string
+ */
+function wporg_themes_found_posts( $found_posts, $wp_query ) {
+ if ( $wp_query->is_main_query() && 'featured' === $wp_query->get( 'browse' ) ) {
+ $found_posts = $wp_query->get( 'posts_per_page' );
+ }
+
+ return $found_posts;
+}
+add_filter( 'found_posts', 'wporg_themes_found_posts', 10, 2 );
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Capability mapping for custom caps.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $caps Returns the user's actual capabilities.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,18 +242,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wporg_themes_post_thumbnail_html( $html, $post_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wporg_themes_post_thumbnail_html( $html, $post_id, $post_thumbnail_id, $size ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'repopackage' == $post->post_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = new WPORG_Themes_Repo_Package( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // no size because we only have one (unknown) image size, so the theme needs to size with css
- $html = '<img src="' . $theme->screenshot_url() . '"/>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $src = add_query_arg( array( 'w' => $size, 'strip' => 'all' ), $theme->screen_shot_url() );
+
+ $html = '<img src="' . esc_url( $src ) . '"/>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $html;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-add_filter( 'post_thumbnail_html', 'wporg_themes_post_thumbnail_html', 10, 2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_filter( 'post_thumbnail_html', 'wporg_themes_post_thumbnail_html', 10, 5 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Prevents repopackages from being deleted.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemescontentsinglephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php 2015-02-17 22:51:44 UTC (rev 1273)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php 2015-02-17 23:18:19 UTC (rev 1274)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,11 +1,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global $theme;
- $theme = wporg_themes_photon_screen_shot( $theme );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$slug = get_post()->post_name;
+$theme = themes_api('theme_information', array( 'slug' => $slug ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-about hentry">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( strtotime( '-2 years' ) > strtotime( $theme->last_updated ) ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( strtotime( '-2 years' ) > get_post_modified_time() ) : ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-notice notice notice-warning">
</span><span class="cx" style="display: block; padding: 0 10px"> <p><?php _e( 'This theme <strong>hasn’t been updated in over 2 years</strong>. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.', 'wporg-themes' ); ?></p>
</span><span class="cx" style="display: block; padding: 0 10px"> </div><!-- .theme-info -->
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,14 +13,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-head">
</span><span class="cx" style="display: block; padding: 0 10px"> <h3 class="theme-name entry-title"><?php the_title(); ?></h3>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <h4 class="theme-author"><?php printf( __( 'By %s' ), sprintf( '<a href="https://profiles.wordpress.org/%s"><span class="author">%s</span><a/>', $theme->author ) ); ?></h4>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <h4 class="theme-author">
+ <?php printf( _x( 'By %s', 'post author', 'wporg-themes' ), sprintf( '<a href="https://profiles.wordpress.org/%s"><span class="author">%s</span></a>', get_the_author_meta( 'login' ), esc_html( get_the_author() ) ) ); ?>
+ </h4>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-actions">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <a href="<?php echo esc_url( '//downloads.wordpress.org/theme/' . $theme->slug . '.' . $theme->version . '.zip' ); ?>" class="button button-primary"><?php _e( 'Download' ); ?></a>
- <a href="<?php echo esc_url( $theme->preview_url ); ?>" class="button button-secondary"><?php _e( 'Preview' ); ?></a>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <a href="<?php echo esc_url( '//wp-themes.com/' . $slug ); ?>" class="button button-secondary"><?php _e( 'Preview' ); ?></a>
+ <a href="<?php echo esc_url( '//downloads.wordpress.org/theme/' . $slug . '.' . $theme->version . '.zip' ); ?>" class="button button-primary"><?php _e( 'Download' ); ?></a>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( ! empty( $theme->parent ) ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( ! empty( get_post()->parent ) ) : ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-notice notice notice-info">
</span><span class="cx" style="display: block; padding: 0 10px"> <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), sprintf( '<a href="/%1$s">%2$s</a>', $theme->parent->slug, $theme->parent->name ) ); ?></p>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,31 +30,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </div><!-- .theme-head -->
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-info">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="screenshot"><?php echo esc_url( $theme->screenshot_url . '?w=732&strip=all' ); ?></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="screenshot"><?php the_post_thumbnail( '798' ); ?></div>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-description entry-summary"><?php the_content(); ?></div>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-tags">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <h4><?php _e( 'Tags:' ); ?></h4>
- <?php
- foreach( $theme->tags as &$tag ) :
- $tag = sprintf( '<a href="%1$s">%2$s</a>', esc_url( home_url( "/tag/{$tag}/" ) ), $tag );
- endforeach;
- echo implode( ', ', $theme->tags );
- ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php the_tags( '<h4>' . __( 'Tags:' ) . '</h4>' ); ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div><!-- .theme-tags -->
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-downloads">
</span><span class="cx" style="display: block; padding: 0 10px"> <h4><?php _e( 'Downloads', 'wporg-themes' ); ?></h4>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div id="theme-download-stats-<?php echo esc_attr( $theme->slug ); ?>" class="chart"></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div id="theme-download-stats-<?php echo esc_attr( $slug ); ?>" class="chart"></div>
</ins><span class="cx" style="display: block; padding: 0 10px"> <script type="text/javascript">
</span><span class="cx" style="display: block; padding: 0 10px"> google.load("visualization", "1", {packages:["corechart"]});
</span><span class="cx" style="display: block; padding: 0 10px"> google.setOnLoadCallback(drawThemeDownloadsChart);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function drawThemeDownloadsChart() {
</span><span class="cx" style="display: block; padding: 0 10px"> jQuery(document).ready(function($){
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- jQuery.getJSON('https://api.wordpress.org/stats/themes/1.0/downloads.php?slug=<?php echo $theme->slug; ?>&limit=730&callback=?', function (downloads) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $.getJSON('https://api.wordpress.org/stats/themes/1.0/downloads.php?slug=<?php echo $slug; ?>&limit=730&callback=?', function (downloads) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var data = new google.visualization.DataTable(),
</span><span class="cx" style="display: block; padding: 0 10px"> count = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,7 +62,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> count++;
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- new google.visualization.ColumnChart(document.getElementById('theme-download-stats-<?php echo esc_attr( $theme->slug ); ?>')).draw(data, {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ new google.visualization.ColumnChart(document.getElementById('theme-download-stats-<?php echo esc_attr( $slug ); ?>')).draw(data, {
</ins><span class="cx" style="display: block; padding: 0 10px"> colors: ['#253578'],
</span><span class="cx" style="display: block; padding: 0 10px"> legend: {
</span><span class="cx" style="display: block; padding: 0 10px"> position: 'none'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,9 +113,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( ! empty( $theme->ratings ) && ! empty( $theme->num_ratings ) ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <ul>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php foreach ( $theme->ratings as $key => $rate_count ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ foreach ( $theme->ratings as $key => $rate_count ) :
+ // Hack to have descending key/value pairs.
+ $key = 6 - $key;
+ $rate_count = $theme->ratings[ $key ];
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <li class="counter-container">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <a href="//wordpress.org/support/view/theme-reviews/<?php echo esc_attr( $theme->slug ); ?>?filter=<?php echo $key; ?>" title="<?php printf( _n( 'Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $key, 'wporg-themes' ), $key ); ?>">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <a href="//wordpress.org/support/view/theme-reviews/<?php echo esc_attr( $slug ); ?>?filter=<?php echo $key; ?>" title="<?php printf( _n( 'Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $key, 'wporg-themes' ), $key ); ?>">
</ins><span class="cx" style="display: block; padding: 0 10px"> <span class="counter-label"><?php printf( __( '%d stars', 'wporg-themes' ), $key ); ?></span>
</span><span class="cx" style="display: block; padding: 0 10px"> <span class="counter-back">
</span><span class="cx" style="display: block; padding: 0 10px"> <span class="counter-bar" style="width: <?php echo 100 * ( $rate_count / $theme->num_ratings ); ?>px;"></span>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,12 +133,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </div><!-- .theme-rating -->
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="theme-support">
+ <h4><?php _e( 'Support', 'wporg-themes' ); ?></h4>
+ <p><?php _e( 'Got something to say? Neeed help?', 'wporg-themes' ); ?></p>
+ <a href="//wordpress.org/support/theme/<?php echo esc_attr( $slug ); ?>" class="button button-secondary"><?php _e( 'View support forum', 'wporg-themes' ); ?></a>
+ </div><!-- .theme-support -->
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-devs">
</span><span class="cx" style="display: block; padding: 0 10px"> <h4><?php _e( 'Development', 'wporg-themes' ); ?></h4>
</span><span class="cx" style="display: block; padding: 0 10px"> <h5><?php _e( 'Subscribe', 'wporg-themes' ); ?></h5>
</span><span class="cx" style="display: block; padding: 0 10px"> <ul class="unmarked-list">
</span><span class="cx" style="display: block; padding: 0 10px"> <li>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <a href="//themes.trac.wordpress.org/log/<?php echo esc_attr( $theme->slug ); ?>?limit=100&mode=stop_on_copy&format=rss">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <a href="//themes.trac.wordpress.org/log/<?php echo esc_attr( $slug ); ?>?limit=100&mode=stop_on_copy&format=rss">
</ins><span class="cx" style="display: block; padding: 0 10px"> <img src="//s.w.org/style/images/feedicon.png" />
</span><span class="cx" style="display: block; padding: 0 10px"> <?php _e( 'Development Log', 'wporg' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </a>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,11 +153,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <h5><?php _e( 'Browse the Code', 'wporg-themes' ); ?></h5>
</span><span class="cx" style="display: block; padding: 0 10px"> <ul class="unmarked-list">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <li><a href="//themes.trac.wordpress.org/log/<?php echo esc_attr( $theme->slug ); ?>/" rel="nofollow"><?php _e( 'Development Log', 'wporg-themes' ); ?></a></li>
- <li><a href="//themes.svn.wordpress.org/<?php echo esc_attr( $theme->slug ); ?>/" rel="nofollow"><?php _e( 'Subversion Repository', 'wporg-themes' ); ?></a></li>
- <li><a href="//themes.trac.wordpress.org/browser/<?php echo esc_attr( $theme->slug ); ?>/" rel="nofollow"><?php _e( 'Browse in Trac', 'wporg-themes' ); ?></a></li>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <li><a href="//themes.trac.wordpress.org/log/<?php echo esc_attr( $slug ); ?>/" rel="nofollow"><?php _e( 'Development Log', 'wporg-themes' ); ?></a></li>
+ <li><a href="//themes.svn.wordpress.org/<?php echo esc_attr( $slug ); ?>/" rel="nofollow"><?php _e( 'Subversion Repository', 'wporg-themes' ); ?></a></li>
+ <li><a href="//themes.trac.wordpress.org/browser/<?php echo esc_attr( $slug ); ?>/" rel="nofollow"><?php _e( 'Browse in Trac', 'wporg-themes' ); ?></a></li>
</ins><span class="cx" style="display: block; padding: 0 10px"> </ul>
</span><span class="cx" style="display: block; padding: 0 10px"> </div><!-- .theme-devs -->
</span><span class="cx" style="display: block; padding: 0 10px"> </div><!-- .theme-meta -->
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="theme-footer">
+ <a class="index-link" rel="home" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Return to Themes List', 'wporg-themes' ); ?></a>
+ <?php the_post_navigation( array(
+ 'prev_text' => '<span class="screen-reader-text">' . __( 'Next', 'wporg-themes' ) . '</span>',
+ 'next_text' => '<span class="screen-reader-text">' . __( 'Previous', 'wporg-themes' ) . '</span>',
+ ) ); ?>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemescontentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content.php 2015-02-17 22:51:44 UTC (rev 1273)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content.php 2015-02-17 23:18:19 UTC (rev 1274)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,18 +1,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global $theme;
- $theme = wporg_themes_photon_screen_shot( $theme );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$post = get_post();
+$theme = new WPORG_Themes_Repo_Package( $post );
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<article id="post-<?php echo $theme->slug; ?>" class="theme hentry">
- <a class="url" href="<?php echo esc_url( home_url( $theme->slug . '/' ) ); ?>" rel="bookmark" tabindex="-1">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<article id="post-<?php echo $post->post_name; ?>" class="theme hentry">
+ <a class="url" href="<?php the_permalink(); ?>" rel="bookmark">
</ins><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-screenshot">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <img src="<?php echo esc_url( $theme->screenshot_url . '?w=572&strip=all' ); ?>" alt="">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php the_post_thumbnail( '572' ); ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <span class="more-details"><?php _ex( 'More Info', 'theme' ); ?></span>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="theme-author"><?php printf( __( 'By %s' ), '<span class="author">' . $theme->author . '</span>' ); ?></div>
- <h3 class="theme-name entry-title"><?php echo $theme->name; ?></h3>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="theme-author">
+ <?php printf( _x( 'By %s', 'post author', 'wporg-themes' ), '<span class="author vcard">' . esc_html( get_the_author() ) . '</span>' ); ?>
+ </div>
+ <h3 class="theme-name entry-title"><?php the_title(); ?></h3>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-actions">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <a class="button button-primary preview install-theme-preview" href="<?php echo esc_url( '//downloads.wordpress.org/theme/' . $theme->slug . '.' . $theme->version . '.zip' ); ?>"><?php esc_html_e( 'Download' ); ?></a>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <a class="button button-primary preview install-theme-preview" href="<?php echo esc_url( '//downloads.wordpress.org/theme/' . $post->post_name . '.' . $theme->latest_version() . '.zip' ); ?>"><?php esc_html_e( 'Download' ); ?></a>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> </a>
</span><span class="cx" style="display: block; padding: 0 10px"> </article>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php 2015-02-17 22:51:44 UTC (rev 1273)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php 2015-02-17 23:18:19 UTC (rev 1274)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,65 +54,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'after_setup_theme', 'wporg_themes_setup' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Makes an API request to retrieve the right themes for the current query.
- *
- * @param WP_Query $query
- * @return WP_Query
- */
-function wporg_themes_set_up_query( $query ) {
- if ( is_admin() || in_array( $query->query_vars['pagename'], array( 'upload', 'commercial' ) ) || 'nav_menu_item' == $query->get( 'post_type' ) ) {
- return $query;
- }
-
- $query->set( 'post_type', 'repopackage' );
-
- $args = array(
- 'per_page' => 15,
- 'fields' => array(
- 'description' => true,
- 'sections' => false,
- 'tested' => true,
- 'requires' => true,
- 'rating' => true,
- 'downloaded' => true,
- 'downloadlink' => true,
- 'last_updated' => true,
- 'homepage' => true,
- 'tags' => true,
- 'num_ratings' => true,
- 'parent' => true,
- ),
- );
-
- if ( $query->query_vars['tag'] ) {
- $args['tag'][] = $query->query_vars['tag'];
- }
- elseif ( $query->query_vars['author_name'] ) {
- $args['author'] = $query->query_vars['author_name'];
- }
- elseif ( $query->query_vars['pagename'] ) {
- $slugs = explode( '/', $query->query_vars['pagename'] );
-
- if ( count( $slugs ) > 1 && 'browse' == $slugs[0] ) {
- $args['browse'] = $slugs[1];
- } else {
- $args['theme'] = $slugs[0];
- }
- }
- else {
- $args['browse'] = 'featured';
- }
-
- if ( ! function_exists( 'themes_api' ) ) {
- include ABSPATH . 'wp-admin/includes/theme.php';
- }
- $GLOBALS['themes'] = themes_api( 'query_themes', $args );
-
- return $query;
-}
-add_filter( 'pre_get_posts', 'wporg_themes_set_up_query' );
-
-/**
</del><span class="cx" style="display: block; padding: 0 10px"> * Enqueue scripts and styles.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wporg_themes_scripts() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,7 +63,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'themes-style', self_admin_url( 'css/themes.css' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'wporg-themes-style', get_stylesheet_uri() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_enqueue_script( 'google-jsapi', '//www.google.com/jsapi', array(), null );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_enqueue_script( 'google-jsapi', '//www.google.com/jsapi', array( 'jquery' ), null );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_singular( 'page' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'theme', self_admin_url( 'js/theme.js' ), array( 'wp-backbone' ), false, true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,7 +139,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wporg_themes_api_args( $args, $action ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'query_themes' == $action ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $action, array( 'query_themes', 'theme_information' ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $args->per_page = 30;
</span><span class="cx" style="display: block; padding: 0 10px"> $args->fields['parent'] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> $args->fields['ratings'] = true;
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesindexphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php 2015-02-17 22:51:44 UTC (rev 1273)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php 2015-02-17 23:18:19 UTC (rev 1274)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,17 +11,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @package wporg-themes
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( ! function_exists( 'get_theme_feature_list' ) ) {
+ include ABSPATH . 'wp-admin/includes/theme.php';
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> get_header();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-global $themes;
</del><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="themes" class="wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wp-filter">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="filter-count">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <span class="count theme-count"><?php echo count( $themes->themes ); ?></span>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <span class="count theme-count"><?php echo $GLOBALS['wp_query']->found_posts; ?></span>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <ul class="filter-links">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,16 +64,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-browser content-filterable">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="themes" style="display:none;">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! is_wp_error( $themes ) ) :
- if ( is_single() ) :
- $theme = array_shift( $themes->themes );
- get_template_part( 'content', 'single' );
- else :
- foreach ( $themes->themes as $theme ) :
- get_template_part( 'content', 'index' );
- endforeach;
- endif;
- endif;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while ( have_posts() ) :
+ the_post();
+ get_template_part( 'content', is_single() ? 'single' : 'index' );
+ endwhile;
+
+ the_posts_navigation( array(
+ 'prev_text' => __( 'Next', 'wporg-themes' ),
+ 'next_text' => __( 'Previous', 'wporg-themes' ),
+ ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesstylecss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/style.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/style.css 2015-02-17 22:51:44 UTC (rev 1273)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/style.css 2015-02-17 23:18:19 UTC (rev 1274)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,6 +56,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* Clearing */
</span><span class="cx" style="display: block; padding: 0 10px"> .clear:before,
</span><span class="cx" style="display: block; padding: 0 10px"> .clear:after,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.theme-wrap .theme-about:before,
+.theme-wrap .theme-about:after,
</ins><span class="cx" style="display: block; padding: 0 10px"> .main-navigation:before,
</span><span class="cx" style="display: block; padding: 0 10px"> .main-navigation:after {
</span><span class="cx" style="display: block; padding: 0 10px"> content: "";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,6 +65,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .clear:after,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.theme-wrap .theme-about:after,
</ins><span class="cx" style="display: block; padding: 0 10px"> .main-navigation:after {
</span><span class="cx" style="display: block; padding: 0 10px"> clear: both;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +107,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .theme-browser .themes {
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.theme-browser .themes:not(:empty) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body:not(.single) .theme-browser .themes:not(:empty) {
</ins><span class="cx" style="display: block; padding: 0 10px"> font-size: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 0 0 100px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,7 +137,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 100px 0 150px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.theme-overlay .theme-about {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.theme-wrap .theme-about {
</ins><span class="cx" style="display: block; padding: 0 10px"> bottom: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -257,8 +260,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* Single View */
</span><span class="cx" style="display: block; padding: 0 10px"> .single .theme-wrap {
</span><span class="cx" style="display: block; padding: 0 10px"> background: #fff;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- box-shadow: 0 1px 20px 5px rgba(0, 0, 0, 0.1);
- margin: 3% 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border: 1px solid #e5e5e5;
+ box-shadow: 0 1px 1px rgba(0,0,0,0.04);
+ margin-bottom: 3%;
</ins><span class="cx" style="display: block; padding: 0 10px"> overflow: hidden;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 2% 4%;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -336,7 +340,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> border: 1px solid #fff;
</span><span class="cx" style="display: block; padding: 0 10px"> box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
</span><span class="cx" style="display: block; padding: 0 10px"> box-sizing: border-box;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- overflow: hidden;
</del><span class="cx" style="display: block; padding: 0 10px"> position: relative;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -832,6 +835,95 @@
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* Themes Navigation */
+.posts-navigation {
+ font-size: 18px;
+ overflow: hidden;
+}
+
+.posts-navigation .nav-previous {
+ float: right;
+}
+
+.posts-navigation .nav-next {
+ float: left;
+}
+
+.posts-navigation .nav-links a {
+ padding: 8px 10px;
+ display: inline-block;
+}
+
+.posts-navigation .nav-previous a:after {
+ content: '\2192';
+ margin: 0 -10px 0 5px;
+}
+
+.posts-navigation .nav-next a:before {
+ content: '\2190';
+ margin: 0 5px 0 -10px;
+ vertical-align: middle;
+}
+
+/* Single Theme Footer */
+.theme-wrap .theme-footer {
+ border-top: 1px solid #ddd;
+ clear: both;
+ margin: 25px -38px -19px;
+ height: 48px;
+}
+
+.index-link {
+ display: inline-block;
+ font-size: 14px;
+ font-weight: 700;
+ padding: 13px 15px;
+}
+
+.index-link:before {
+ content: '\2190';
+ margin-right: 5px;
+}
+
+.post-navigation {
+ float: right;
+ width: 110px;
+ height: 48px;
+}
+
+.post-navigation .nav-links a {
+ border: 0;
+ border-left: 1px solid #ddd;
+ color: #777;
+ float: left;
+ height: 48px;
+ text-align: center;
+ -webkit-transition: color .1s ease-in-out, background .1s ease-in-out;
+ transition: color .1s ease-in-out, background .1s ease-in-out;
+ vertical-align: top;
+ width: 54px;
+}
+
+.post-navigation .nav-links a:before {
+ font: 400 20px/50px dashicons !important;
+ text-decoration: inherit;
+ -webkit-font-smoothing: antialiased;
+}
+
+.post-navigation .nav-links a:hover,
+.post-navigation .nav-links a:focus {
+ background: #ddd;
+ border-color: #ccc;
+ color: #000;
+}
+.post-navigation .nav-previous a:before {
+ content: '\f341';
+}
+
+.post-navigation .nav-next a:before {
+ content: '\f345';
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Theme notices */
</span><span class="cx" style="display: block; padding: 0 10px"> .notice,
</span><span class="cx" style="display: block; padding: 0 10px"> .error {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1003,4 +1095,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> margin: auto;
</span><span class="cx" style="display: block; padding: 0 10px"> width: 100%;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ .posts-navigation {
+ margin-top: 40px;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre>
</div>
</div>
</body>
</html>