PHP 클래스 Pressbooks\Modules\Import\WordPress\Wxr

상속: extends PressBooks\Modules\Import\Import
파일 보기 프로젝트 열기: pressbooks/pressbooks

보호된 프로퍼티들

프로퍼티 타입 설명
$isPbWxr boolean If Pressbooks generated the WXR file

공개 메소드들

메소드 설명
import ( array $current_import ) : boolean
setCurrentImportOption ( array $upload ) : boolean

보호된 메소드들

메소드 설명
bookInfoPid ( ) : integer Get existing Meta Post, if none exists create one
customNestedSort ( array $xml ) : array Custom sort for the xml posts to put them in correct nested order
fetchAndSaveUniqueImage ( string $url ) : string Load remote url of image into WP using media_handle_sideload() Will return an empty string if something went wrong.
importMetaBoxes ( integer $pid, array $p )
importPbPostMeta ( integer $pid, string $post_type, array $p ) Import Pressbooks specific post meta
insertNewPost ( string $post_type, array $p, string $html, integer $chapter_parent ) : integer Insert a new post
pbCheck ( array $xml ) Is it a WXR generated by PB?
scrapeAndKneadImages ( DOMDocument $doc ) : DOMDocument Parse HTML snippet, save all found tags using media_handle_sideload(), return the HTML with changed paths.
searchForMetaValue ( $meta_key, array $postmeta ) : string Check for PB specific metadata, returns empty string if not found.

메소드 상세

bookInfoPid() 보호된 메소드

Get existing Meta Post, if none exists create one
protected bookInfoPid ( ) : integer
리턴 integer Post ID

customNestedSort() 보호된 메소드

Custom sort for the xml posts to put them in correct nested order
protected customNestedSort ( array $xml ) : array
$xml array
리턴 array sorted $xml

fetchAndSaveUniqueImage() 보호된 메소드

Load remote url of image into WP using media_handle_sideload() Will return an empty string if something went wrong.
또한 보기: media_handle_sideload
protected fetchAndSaveUniqueImage ( string $url ) : string
$url string
리턴 string filename

import() 공개 메소드

public import ( array $current_import ) : boolean
$current_import array
리턴 boolean

importMetaBoxes() 보호된 메소드

또한 보기: Pressbooks\Admin\Metaboxes\add_meta_boxes
protected importMetaBoxes ( integer $pid, array $p )
$pid integer Post ID
$p array Single Item Returned From \Pressbooks\Modules\Import\WordPress\Parser::parse

importPbPostMeta() 보호된 메소드

Import Pressbooks specific post meta
protected importPbPostMeta ( integer $pid, string $post_type, array $p )
$pid integer Post ID
$post_type string Post Type
$p array Single Item Returned From \Pressbooks\Modules\Import\WordPress\Parser::parse

insertNewPost() 보호된 메소드

Insert a new post
protected insertNewPost ( string $post_type, array $p, string $html, integer $chapter_parent ) : integer
$post_type string Post Type
$p array Single Item Returned From \Pressbooks\Modules\Import\WordPress\Parser::parse
$html string
$chapter_parent integer
리턴 integer Post ID

pbCheck() 보호된 메소드

Is it a WXR generated by PB?
protected pbCheck ( array $xml )
$xml array

scrapeAndKneadImages() 보호된 메소드

Parse HTML snippet, save all found tags using media_handle_sideload(), return the HTML with changed paths.
protected scrapeAndKneadImages ( DOMDocument $doc ) : DOMDocument
$doc DOMDocument
리턴 DOMDocument

searchForMetaValue() 보호된 메소드

Check for PB specific metadata, returns empty string if not found.
protected searchForMetaValue ( $meta_key, array $postmeta ) : string
$postmeta array
리턴 string meta field value

setCurrentImportOption() 공개 메소드

public setCurrentImportOption ( array $upload ) : boolean
$upload array
리턴 boolean

프로퍼티 상세

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

If Pressbooks generated the WXR file
protected bool $isPbWxr
리턴 boolean