script_concat_settings() - WordPress 函数参考中文文档

返回介绍

script_concat_settings()

发布于 2017-09-11 字数2204 浏览 837 评论 0

script_concat_settings()

Determine the concatenation and compression settings for scripts and styles.


描述


源代码

File: wp-includes/script-loader.php

function script_concat_settings() {
	global $concatenate_scripts, $compress_scripts, $compress_css;

	$compressed_output = ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') );

	if ( ! isset($concatenate_scripts) ) {
		$concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true;
		if ( ( ! is_admin() && ! did_action( 'login_init' ) ) || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) )
			$concatenate_scripts = false;
	}

	if ( ! isset($compress_scripts) ) {
		$compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true;
		if ( $compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output ) )
			$compress_scripts = false;
	}

	if ( ! isset($compress_css) ) {
		$compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true;
		if ( $compress_css && ( ! get_site_option('can_compress_scripts') || $compressed_output ) )
			$compress_css = false;
	}
}

更新日志

Version 描述
2.8.0 Introduced.

相关函数

Uses

  • wp-includes/load.php:
    is_admin()
  • wp-includes/plugin.php:
    did_action()
  • wp-includes/option.php:
    get_site_option()

Used By

  • wp-includes/class-wp-editor.php:
    _WP_Editors::print_tinymce_scripts()
  • wp-includes/script-loader.php:
    print_head_scripts()
  • wp-includes/script-loader.php:
    print_footer_scripts()
  • wp-includes/script-loader.php:
    print_admin_styles()
  • wp-includes/script-loader.php:
    print_late_styles()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!