From 82f730aacd846fc5af9e6101803fcdcfd77c194b Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 15 Oct 2012 13:36:32 -0400 Subject: [PATCH 1/6] Let sites regenerate rewrite rules after install. see #44. --- install.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/install.php b/install.php index 9a1fb0aa..4ef3462e 100644 --- a/install.php +++ b/install.php @@ -71,8 +71,6 @@ function jquery_install_site( $site, $user ) { $default_options = jquery_default_site_options(); $default_options['admin_email'] = $user->user_email; - var_dump( $domain, $path, $site ); - if ( 1 !== $details['blog_id'] ) { $blog_id = insert_blog( JQUERY_STAGING_PREFIX . $domain, $path, 1 ); if ( $blog_id != $details['blog_id'] ) @@ -89,6 +87,6 @@ function jquery_install_site( $site, $user ) { foreach ( $options as $option => $value ) update_option( $option, $value ); - flush_rewrite_rules(); + delete_option( 'rewrite_rules' ); restore_current_blog(); } From eeea283241b257ecd7672a2c77bebb1162098631 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 15 Oct 2012 13:36:54 -0400 Subject: [PATCH 2/6] Don't run the ms site check during install. --- sunrise.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sunrise.php b/sunrise.php index b684bbac..1fe1079e 100644 --- a/sunrise.php +++ b/sunrise.php @@ -12,6 +12,8 @@ $current_blog->blog_id = $current_blog->site_id = $current_blog->public = 1; $current_blog->archived = $current_blog->deleted = $current_blog->spam = 0; + add_filter( 'ms_site_check', '__return_true' ); + if ( ! defined( 'WP_INSTALLING' ) ) { // Okay, see if we can find the main site in the DB. // If not, time for a new network install. From eefcbb00030448d1395d3f333fd9d1dfdd045cd1 Mon Sep 17 00:00:00 2001 From: Ron Rudy Date: Mon, 15 Oct 2012 16:30:32 -0300 Subject: [PATCH 3/6] Update README.md Updated to ensure overrides are enabled for entry --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 5227dfa2..d76fbe5e 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,12 @@ This is a set of plugins, themes, and configuration files for jQuery's website i ServerName dev.jquery.com ServerAlias *.jquery.com *.jqueryui.com *.jquery.org *.qunitjs.com *.sizzlejs.com *.jquerymobile.com DocumentRoot "/srv/www/jquery" + + Options All + AllowOverride All + Order allow,deny + Allow from all + ``` From aa2e690a03b311bf78627b5e7e1a3316fdbc774c Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 15 Oct 2012 16:01:32 -0400 Subject: [PATCH 4/6] Allow a post custom field of body_class (separated by spaces) to inject classes into the body element. --- mu-plugins/jquery-filters.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mu-plugins/jquery-filters.php b/mu-plugins/jquery-filters.php index 80ddb693..a295f52e 100644 --- a/mu-plugins/jquery-filters.php +++ b/mu-plugins/jquery-filters.php @@ -59,3 +59,12 @@ function jquery_unfiltered_html_for_term_descriptions() { // Bypass multisite checks. add_filter( 'ms_site_check', '__return_true' ); + +// Add body classes found in postmeta. +add_filter( 'body_class', function( $classes ) { + if ( ! is_singular() ) + return $classes; + if ( ! $post_classes = get_post_meta( get_queried_object_id(), 'body_class', true ) ) + return $classes; + return array_merge( $classes, explode( ' ', $post_classes ) ); +}); From c92b29a260bc5c54bf2dafba6077ec63f6caa3fb Mon Sep 17 00:00:00 2001 From: Josh Clanton Date: Mon, 15 Oct 2012 17:18:39 -0400 Subject: [PATCH 5/6] Added plugin download tracker JS Not yet sure how this should be included in the plugins download page. --- .../plugins.jquery.com/js/download-tracker.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 themes/plugins.jquery.com/js/download-tracker.js diff --git a/themes/plugins.jquery.com/js/download-tracker.js b/themes/plugins.jquery.com/js/download-tracker.js new file mode 100644 index 00000000..649620c4 --- /dev/null +++ b/themes/plugins.jquery.com/js/download-tracker.js @@ -0,0 +1,17 @@ +$(document).ready(function() { + // Tracks clicks of the plugin download button + $("a.download").click(function(event) { + // Query parameter distinguishes click tracking request from normal page load + var clickTrackerURL = window.location + "?d=1"; + var downloadURL = $(this).attr("href"); + + event.preventDefault(); + + $.ajax({ + type: "HEAD", + url: clickTrackerURL + }).done(function() { + window.location = downloadURL; + }); + }); +}); \ No newline at end of file From d1820578ab1a708cf5fba6cbb233a0452cddd896 Mon Sep 17 00:00:00 2001 From: Josh Clanton Date: Tue, 16 Oct 2012 15:43:13 -0400 Subject: [PATCH 6/6] Turn on plugin download tracking Attached the WP functions to pull the tracker JS file in. --- themes/plugins.jquery.com/content-jquery_plugin.php | 3 ++- themes/plugins.jquery.com/functions.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/themes/plugins.jquery.com/content-jquery_plugin.php b/themes/plugins.jquery.com/content-jquery_plugin.php index 0fbadecf..24f17d4b 100755 --- a/themes/plugins.jquery.com/content-jquery_plugin.php +++ b/themes/plugins.jquery.com/content-jquery_plugin.php @@ -6,7 +6,8 @@ * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ -?> + +wp_enqueue_script( 'jquery-plugin-download' ); ?>
>
diff --git a/themes/plugins.jquery.com/functions.php b/themes/plugins.jquery.com/functions.php index ba57fdf4..e7bd8b15 100644 --- a/themes/plugins.jquery.com/functions.php +++ b/themes/plugins.jquery.com/functions.php @@ -1,5 +1,9 @@ post_parent ) ? $post->ID : $post->post_parent;