Skip to content

Commit

Permalink
Enforce the option values that are in domains.php even after installa…
Browse files Browse the repository at this point in the history
…tion. fixes jquery#40.
  • Loading branch information
nacin committed Jun 26, 2012
1 parent 0c11008 commit ea7b625
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
3 changes: 2 additions & 1 deletion domains.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,11 @@ function jquery_domains() {

function jquery_default_site_options() {
return array(
'enable_xmlrpc' => true,
'enable_xmlrpc' => 1,
'template' => 'jquery',
'blogdescription' => '',
'permalink_structure' => '/%postname%/',
'use_smilies' => 0,
);

}
20 changes: 15 additions & 5 deletions mu-plugins/jquery-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
* Description: Default filters, option values, and other tweaks.
*/

// Disable smilies.
add_filter( 'pre_option_use_smilies', '__return_zero' );

// Turn on XML-RPC.
add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
$live_domain = $_SERVER['HTTP_HOST'];
if ( JQUERY_STAGING )
$live_domain = str_replace( JQUERY_STAGING_PREFIX, '', $live_domain );
$options = jquery_default_site_options();
$domains = jquery_domains();
$live_domain = str_replace( JQUERY_STAGING_PREFIX, '', $_SERVER['HTTP_HOST'] );
$options = array_merge( $options, $domains[ $live_domain ]['options'] );
foreach ( $options as $option => $value ) {
if ( 'stylesheet' === $option || 'template' === $option )
continue; // Don't mess with themes for now.
add_filter( 'pre_option_' . $option, function( $null ) use ( $value ) {
return $value;
} );
}
unset( $domains, $live_domain, $options, $option, $value );

// Disable WordPress auto-paragraphing for posts.
remove_filter( 'the_content', 'wpautop' );
Expand Down

0 comments on commit ea7b625

Please sign in to comment.