diff --git a/README.md b/README.md index d55bd9c6..5e5a7d51 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 local.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 + ``` 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(); } 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 ) ); +}); 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. 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; 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