Свойство | Type | Description | |
---|---|---|---|
$base_url | |||
$categories | information to import from WXR file | ||
$exists | |||
$featured_images | |||
$logger | WP_Importer_Logger | Logger instance. | |
$mapping | NEW STYLE | ||
$menu_item_orphans | |||
$missing_menu_items | |||
$processed_menu_items | |||
$processed_posts | |||
$processed_terms | TODO: REMOVE THESE | ||
$requires_remapping | |||
$tags | |||
$url_remap | |||
$user_slug_override | |||
$version | string | Defaults to 1.0 for compatibility. Typically overridden by a
|
Méthode | Description | |
---|---|---|
__construct ( array $options = [] ) | Constructor | |
bump_request_timeout ( $val ) : integer | Added to http_request_timeout filter to force timeout at 60 seconds during import | |
cmpr_strlen ( $a, $b ) | return the difference in length between two strings | |
get_preliminary_information ( string $file ) | The main controller for the actual import stage. | |
import ( string $file ) | The main controller for the actual import stage. | |
is_valid_meta_key ( string $key ) : string | boolean | Decide if the given meta key maps to information we will want to import | |
parse_authors ( string $file ) | The main controller for the actual import stage. | |
remap_featured_images ( ) | Update _thumbnail_id meta to new, imported attachment IDs | |
set_logger ( $logger ) | ||
set_user_mapping ( array $mapping ) | Set the user mapping. | |
set_user_slug_overrides ( string[] $overrides ) | Set the user slug overrides. | |
sort_comments_by_id ( array $a, array $b ) : integer | Callback for usort to sort comments by ID |
Méthode | Description | |
---|---|---|
comment_exists ( array $data ) : integer | boolean | Does the comment exist? | |
fetch_remote_file ( string $url, array $post ) : array | WP_Error | Attempt to download a remote file attachment | |
get_reader ( string $file ) : XMLReader | WP_Error | Get a stream reader for the file. | |
import_end ( ) | Performs post-import cleanup of files and the cache | |
import_start ( string $file ) | Parses the WXR file and prepares us for the task of processing parsed data | |
log_error ( WP_Error $error ) | Log an error instance to the logger. | |
mark_comment_exists ( array $data, integer $comment_id ) | Mark the comment as existing. | |
mark_post_exists ( array $data, integer $post_id ) | Mark the post as existing. | |
mark_term_exists ( array $data, integer $term_id ) | Mark the term as existing. | |
max_attachment_size ( ) : integer | Decide what the maximum file size for downloaded attachments is. | |
parse_author_node ( $node ) | ||
parse_category_node ( $node ) | ||
parse_comment_node ( DOMElement $node ) : array | Parse a comment node into comment data. | |
parse_meta_node ( DOMElement $node ) : array | null | Parse a meta node into meta data. | |
parse_post_node ( DOMElement $node ) : array | WP_Error | Parse a post node into post data. | |
parse_term_node ( $node, $type = 'term' ) | ||
post_exists ( array $data ) : integer | boolean | Does the post exist? | |
post_process ( ) | ||
post_process_comments ( $todo ) | ||
post_process_menu_item ( $post_id ) | ||
post_process_posts ( $todo ) | ||
prefill_existing_comments ( ) | Prefill existing comment data. | |
prefill_existing_posts ( ) | Prefill existing post data. | |
prefill_existing_terms ( ) | Prefill existing term data. | |
process_attachment ( array $post, $meta, $remote_url ) : integer | WP_Error | If fetching attachments is enabled then attempt to create a new attachment | |
process_author ( $data, $meta ) | ||
process_comments ( array $comments, integer $post_id, array $post, $post_exists = false ) : integer | WP_Error | Process and import comment data. | |
process_menu_item_meta ( $post_id, $data, $meta ) | Attempt to create a new menu item from import data | |
process_post ( $data, $meta, $comments, $terms ) | Create new posts based on import information | |
process_post_meta ( array $meta, integer $post_id, array $post ) : integer | WP_Error | Process and import post meta items. | |
process_term ( $data, $meta ) | ||
replace_attachment_urls_in_content ( ) | Use stored mapping information to update old attachment URLs | |
term_exists ( array $data ) : integer | boolean | Does the term exist? |
public __construct ( array $options = [] ) | ||
$options | array | { @var bool $prefill_existing_posts Should we prefill `post_exists` calls? (True prefills and uses more memory, false checks once per imported post and takes longer. Default is true.) @var bool $prefill_existing_comments Should we prefill `comment_exists` calls? (True prefills and uses more memory, false checks once per imported comment and takes longer. Default is true.) @var bool $prefill_existing_terms Should we prefill `term_exists` calls? (True prefills and uses more memory, false checks once per imported term and takes longer. Default is true.) @var bool $update_attachment_guids Should attachment GUIDs be updated to the new URL? (True updates the GUID, which keeps compatibility with v1, false doesn't update, and allows deduplication and reimporting. Default is false.) @var bool $fetch_attachments Fetch attachments from the remote server. (True fetches and creates attachment posts, false skips attachments. Default is false.) @var bool $aggressive_url_search Should we search/replace for URLs aggressively? (True searches all posts' content for old URLs and replaces, false checks for `` only. Default is false.) @var int $default_author User ID to use if author is missing or invalid. (Default is null, which leaves posts unassigned.) } |
public bump_request_timeout ( $val ) : integer | ||
Résultat | integer | 60 |
public cmpr_strlen ( $a, $b ) |
public get_preliminary_information ( string $file ) | ||
$file | string | Path to the WXR file for importing |
protected get_reader ( string $file ) : XMLReader | WP_Error | ||
$file | string | Path to the XML file. |
Résultat | XMLReader | WP_Error | Reader instance on success, error otherwise. |
protected import_end ( ) |
protected import_start ( string $file ) | ||
$file | string | Path to the WXR file for importing |
protected log_error ( WP_Error $error ) | ||
$error | WP_Error | Error instance to log. |
protected mark_comment_exists ( array $data, integer $comment_id ) | ||
$data | array | Comment data to mark as existing. |
$comment_id | integer | Comment ID. |
protected mark_post_exists ( array $data, integer $post_id ) | ||
$data | array | Post data to mark as existing. |
$post_id | integer | Post ID. |
protected mark_term_exists ( array $data, integer $term_id ) | ||
$data | array | Term data to mark as existing. |
$term_id | integer | Term ID. |
protected max_attachment_size ( ) : integer | ||
Résultat | integer | Maximum attachment file size to import |
public parse_authors ( string $file ) | ||
$file | string | Path to the WXR file for importing |
protected parse_comment_node ( DOMElement $node ) : array | ||
$node | DOMElement | Parent node of comment data (typically `wp:comment`). |
Résultat | array | Comment data array. |
protected parse_meta_node ( DOMElement $node ) : array | null | ||
$node | DOMElement | Parent node of meta data (typically `wp:postmeta` or `wp:commentmeta`). |
Résultat | array | null | Meta data array on success, or null on error. |
protected parse_post_node ( DOMElement $node ) : array | WP_Error | ||
$node | DOMElement | Parent node of post data (typically `item`). |
Résultat | array | WP_Error | Post data array on success, error otherwise. |
protected prefill_existing_comments ( ) |
protected prefill_existing_posts ( ) |
protected prefill_existing_terms ( ) |
protected process_attachment ( array $post, $meta, $remote_url ) : integer | WP_Error | ||
$post | array | Attachment post details from WXR |
Résultat | integer | WP_Error | Post ID on success, WP_Error otherwise |
protected process_comments ( array $comments, integer $post_id, array $post, $post_exists = false ) : integer | WP_Error | ||
$comments | array | List of comment data arrays. |
$post_id | integer | Post to associate with. |
$post | array | Post data. |
Résultat | integer | WP_Error | Number of comments imported on success, error otherwise. |
protected process_post ( $data, $meta, $comments, $terms ) |
public remap_featured_images ( ) |
protected replace_attachment_urls_in_content ( ) |
public set_user_mapping ( array $mapping ) | ||
$mapping | array | List of map arrays (containing `old_slug`, `old_id`, `new_id`) |
public set_user_slug_overrides ( string[] $overrides ) | ||
$overrides | string[] | Map of old slug to new slug. |
protected WP_Importer_Logger $logger | ||
Résultat | WP_Importer_Logger |
protected string $version | ||
Résultat | string |