wp_import_upload_form

函数


wp_import_upload_form ( $action )
参数
  • (string)
    $action
    The action attribute for the form.
    Required:
定义位置
  • wp-admin/includes/template.php
    , line 971
引入
2.0.0
弃用

Outputs the form used by the importers to accept the data to be imported.

function wp_import_upload_form( $action ) {

	/**
	 * Filters the maximum allowed upload size for import files.
	 *
	 * @since 2.3.0
	 *
	 * @see wp_max_upload_size()
	 *
	 * @param int $max_upload_size Allowed upload size. Default 1 MB.
	 */
	$bytes      = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
	$size       = size_format( $bytes );
	$upload_dir = wp_upload_dir();
	if ( ! empty( $upload_dir['error'] ) ) :
		?>
		

%s (%s)’,
__( ‘Choose a file from your computer:’ ),
/* translators: %s: Maximum allowed file size. */
sprintf( __( ‘Maximum size: %s’ ), $size )
);
?>