WordPress.org

Make WordPress Core

Changeset 10593


Ignore:
Timestamp:
02/18/09 23:38:11 (7 years ago)
Author:
ryan
Message:

Make can_compress_scripts a site option. Add site option wrappers for WP.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r10580 r10593  
    7070 
    7171    if ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') ) { 
    72         update_option('can_compress_scripts', 0); 
     72        update_site_option('can_compress_scripts', 0); 
    7373        die('0'); 
    7474    } 
     
    9999            die; 
    100100        } elseif ( 'no' == $_GET['test'] ) { 
    101             update_option('can_compress_scripts', 0); 
     101            update_site_option('can_compress_scripts', 0); 
    102102        } elseif ( 'yes' == $_GET['test'] ) { 
    103             update_option('can_compress_scripts', 1); 
     103            update_site_option('can_compress_scripts', 1); 
    104104        } 
    105105    } 
  • trunk/wp-admin/admin-footer.php

    r10362 r10593  
    2828do_action("admin_footer-$hook_suffix"); 
    2929 
    30 if ( false === get_option('can_compress_scripts') ) 
     30if ( false === get_site_option('can_compress_scripts') ) 
    3131    compression_test(); 
    3232?> 
  • trunk/wp-includes/functions.php

    r10540 r10593  
    29822982} 
    29832983 
     2984function get_site_option( $key, $default = false, $use_cache = true ) { 
     2985    return get_option($key, $default); 
     2986} 
     2987 
     2988// expects $key, $value not to be SQL escaped 
     2989function add_site_option( $key, $value ) { 
     2990    return add_option($key, $value); 
     2991} 
     2992 
     2993// expects $key, $value not to be SQL escaped 
     2994function update_site_option( $key, $value ) { 
     2995    return update_option($key, $value); 
     2996} 
     2997 
    29842998 
    29852999?> 
  • trunk/wp-includes/script-loader.php

    r10592 r10593  
    687687    if ( ! isset($compress_scripts) ) { 
    688688        $compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true; 
    689         if ( $compress_scripts && ( ! get_option('can_compress_scripts') || $compressed_output ) ) 
     689        if ( $compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output ) ) 
    690690            $compress_scripts = false; 
    691691    } 
     
    693693    if ( ! isset($compress_css) ) { 
    694694        $compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true; 
    695         if ( $compress_css && ( ! get_option('can_compress_scripts') || $compressed_output ) ) 
     695        if ( $compress_css && ( ! get_site_option('can_compress_scripts') || $compressed_output ) ) 
    696696            $compress_css = false; 
    697697    } 
Note: See TracChangeset for help on using the changeset viewer.