media_upload_flash_bypass

函数
media_upload_flash_bypass ( No parameters )

media_upload_flash_bypass函数是一个WordPress过滤器,用于禁用媒体库中的Flash上传器: 当用户的浏览器不支持Flash时,或者当网站所有者出于安全或性能原因不想使用Flash时,就会使用这个函数。

显示多文件上传器信息。

function media_upload_flash_bypass() {
	$browser_uploader = admin_url( 'media-new.php?browser-uploader' );

	$post = get_post();
	if ( $post ) {
		$browser_uploader .= '&post_id=' . (int) $post->ID;
	} elseif ( ! empty( $GLOBALS['post_ID'] ) ) {
		$browser_uploader .= '&post_id=' . (int) $GLOBALS['post_ID'];
	}

	?>
	<p class="upload-flash-bypass">
	<?php
		printf(
			/* translators: 1: URL to browser uploader, 2: Additional link attributes. */
			__( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" %2$s>browser uploader</a> instead.' ),
			$browser_uploader,
			'target="_blank"'
		);
	?>
	</p>
	<?php
}

常见问题

FAQs
查看更多 >