PHP 클래스 WXR_Import_UI, WordPress-Importer

파일 보기 프로젝트 열기: humanmade/WordPress-Importer

보호된 프로퍼티들

프로퍼티 타입 설명
$fetch_attachments boolean Set in {@see \display_import_step}.

공개 메소드들

메소드 설명
__construct ( ) Constructor.
add_mime_type_xml ( array $mimes ) Add .xml files as supported format in the uploader.
dispatch ( ) Render the import page.
handle_async_upload ( ) Handle an async upload.
imported_comment ( ) Send message when a comment has been imported.
imported_post ( integer $id, array $data ) Send message when a post has been imported.
imported_term ( ) Send message when a term has been imported.
imported_user ( ) Send message when a user has been imported.
on_load ( ) Handle load event for the importer.
show_updates_in_header ( ) Show an update notice in the importer header.
stream_import ( ) Run an import, and send an event-stream response.

보호된 메소드들

메소드 설명
allow_create_users ( ) : boolean Decide whether or not the importer is allowed to create users.
allow_fetch_attachments ( ) : boolean Decide whether or not the importer should attempt to download attachment files.
author_select ( integer $index, array $author ) Display import options for an individual author. That is, either create a new user based on import info or map to an existing user
display_author_step ( ) Display the author picker (or upload errors).
display_error ( WP_Error $err, $step )
display_import_step ( ) Display the actual import step.
display_intro_step ( ) Display introductory text and file upload form
emit_sse_message ( mixed $data ) Emit a Server-Sent Events message.
get_author_mapping ( array $args ) : array Get mapping data from request data.
get_data_for_attachment ( integer $id ) : WXR_Import_Info | WP_Error Get preliminary data for an import file.
get_import_options ( ) : array Get options for the importer.
get_importer ( ) : WXR_Importer Get the importer instance.
get_url ( integer $step ) Get the URL for the importer.
handle_select ( integer | string $id ) : boolean | WP_Error Handle a WXR file selected from the media browser.
handle_upload ( ) : boolean | WP_Error Handles the WXR upload and initial parsing of the file to prepare for displaying author import options
render_footer ( ) Render the importer footer.
render_header ( ) Render the importer header.
render_upload_form ( )

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( )

add_mime_type_xml() 공개 메소드

Add .xml files as supported format in the uploader.
public add_mime_type_xml ( array $mimes )
$mimes array Already supported mime types.

allow_create_users() 보호된 메소드

Default is true, can be filtered via import_allow_create_users
protected allow_create_users ( ) : boolean
리턴 boolean True if creating users is allowed

allow_fetch_attachments() 보호된 메소드

Default is true, can be filtered via import_allow_fetch_attachments. The choice made at the import options screen must also be true, false here hides that checkbox.
protected allow_fetch_attachments ( ) : boolean
리턴 boolean True if downloading attachments is allowed

author_select() 보호된 메소드

Display import options for an individual author. That is, either create a new user based on import info or map to an existing user
protected author_select ( integer $index, array $author )
$index integer Index for each author in the form
$author array Author information, e.g. login, display name, email

dispatch() 공개 메소드

Render the import page.
public dispatch ( )

display_author_step() 보호된 메소드

Display the author picker (or upload errors).
protected display_author_step ( )

display_error() 보호된 메소드

protected display_error ( WP_Error $err, $step )
$err WP_Error

display_import_step() 보호된 메소드

Display the actual import step.
protected display_import_step ( )

display_intro_step() 보호된 메소드

Display introductory text and file upload form
protected display_intro_step ( )

emit_sse_message() 보호된 메소드

Emit a Server-Sent Events message.
protected emit_sse_message ( mixed $data )
$data mixed Data to be JSON-encoded and sent in the message.

get_author_mapping() 보호된 메소드

Parses form request data into an internally usable mapping format.
protected get_author_mapping ( array $args ) : array
$args array Raw (UNSLASHED) POST data to parse.
리턴 array Map containing `mapping` and `slug_overrides` keys.

get_data_for_attachment() 보호된 메소드

This is a quick pre-parse to verify the file and grab authors from it.
protected get_data_for_attachment ( integer $id ) : WXR_Import_Info | WP_Error
$id integer Media item ID.
리턴 WXR_Import_Info | WP_Error Import info instance on success, error otherwise.

get_import_options() 보호된 메소드

Get options for the importer.
protected get_import_options ( ) : array
리턴 array Options to pass to WXR_Importer::__construct

get_importer() 보호된 메소드

Get the importer instance.
protected get_importer ( ) : WXR_Importer
리턴 WXR_Importer

get_url() 보호된 메소드

Get the URL for the importer.
protected get_url ( integer $step )
$step integer Go to step rather than start.

handle_async_upload() 공개 메소드

Triggers on async-upload.php?action=wxr-import-upload to handle Plupload requests from the importer.
public handle_async_upload ( )

handle_select() 보호된 메소드

Handle a WXR file selected from the media browser.
protected handle_select ( integer | string $id ) : boolean | WP_Error
$id integer | string Media item to import from.
리턴 boolean | WP_Error True on success, error object otherwise.

handle_upload() 보호된 메소드

Handles the WXR upload and initial parsing of the file to prepare for displaying author import options
protected handle_upload ( ) : boolean | WP_Error
리턴 boolean | WP_Error True on success, error object otherwise.

imported_comment() 공개 메소드

Send message when a comment has been imported.
public imported_comment ( )

imported_post() 공개 메소드

Send message when a post has been imported.
public imported_post ( integer $id, array $data )
$id integer Post ID.
$data array Post data saved to the DB.

imported_term() 공개 메소드

Send message when a term has been imported.
public imported_term ( )

imported_user() 공개 메소드

Send message when a user has been imported.
public imported_user ( )

on_load() 공개 메소드

Handle load event for the importer.
public on_load ( )

render_header() 보호된 메소드

Render the importer header.
protected render_header ( )

render_upload_form() 보호된 메소드

protected render_upload_form ( )

show_updates_in_header() 공개 메소드

Show an update notice in the importer header.

stream_import() 공개 메소드

Streams logs and success messages to the browser to allow live status and updates.
public stream_import ( )

프로퍼티 상세

$fetch_attachments 보호되어 있는 프로퍼티

Set in {@see \display_import_step}.
protected bool $fetch_attachments
리턴 boolean