返回介绍

wp_plupload_default_settings()

发布于 2017-09-11 12:34:51 字数 2746 浏览 1036 评论 0 收藏 0

wp_plupload_default_settings()

Prints default Plupload arguments.


description


源代码

File: wp-includes/media.php

function wp_plupload_default_settings() {
	$wp_scripts = wp_scripts();

	$data = $wp_scripts->get_data( 'wp-plupload', 'data' );
	if ( $data && false !== strpos( $data, '_wpPluploadSettings' ) )
		return;

	$max_upload_size = wp_max_upload_size();
	$allowed_extensions = array_keys( get_allowed_mime_types() );
	$extensions = array();
	foreach ( $allowed_extensions as $extension ) {
		$extensions = array_merge( $extensions, explode( '|', $extension ) );
	}

	$defaults = array(
		'runtimes'            => 'html5,flash,silverlight,html4',
		'file_data_name'      => 'async-upload', // key passed to $_FILE.
		'url'                 => admin_url( 'async-upload.php', 'relative' ),
		'flash_swf_url'       => includes_url( 'js/plupload/plupload.flash.swf' ),
		'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
		'filters' => array(
			'max_file_size'   => $max_upload_size . 'b',
			'mime_types'      => array( array( 'extensions' => implode( ',', $extensions ) ) ),
		),
	);

	// Currently only iOS Safari supports multiple files uploading but iOS 7.x has a bug that prevents uploading of videos
	// when enabled. See

更新日志

Versiondescription
3.4.0Introduced.

相关函数

Uses

  • wp-includes/functions.wp-scripts.php: wp_scripts()
  • wp-includes/functions.php: wp_json_encode()
  • wp-includes/pluggable.php: wp_create_nonce()
  • wp-includes/vars.php: wp_is_mobile()
  • wp-includes/load.php: is_multisite()
  • wp-includes/functions.php: _device_can_upload()
  • wp-includes/functions.php: get_allowed_mime_types()
  • wp-includes/link-template.php: admin_url()
  • wp-includes/link-template.php: includes_url()
  • wp-includes/plugin.php: apply_filters()
  • wp-includes/media.php: wp_max_upload_size()
  • wp-includes/media.php: plupload_default_settings
  • wp-includes/media.php: plupload_default_params
  • wp-includes/ms-functions.php: is_upload_space_available()
  • Show 9 more uses Hide more uses

Used By

  • wp-includes/media.php: wp_enqueue_media()

User Contributed Notes

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文