Свойство | Тип | Описание | |
---|---|---|---|
$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. |
protected bookInfoPid ( ) : integer | ||
Результат | integer | Post ID |
protected customNestedSort ( array $xml ) : array | ||
$xml | array | |
Результат | array | sorted $xml |
protected fetchAndSaveUniqueImage ( string $url ) : string | ||
$url | string | |
Результат | string | filename |
protected importMetaBoxes ( integer $pid, array $p ) | ||
$pid | integer | Post ID |
$p | array | Single Item Returned From \Pressbooks\Modules\Import\WordPress\Parser::parse |
protected scrapeAndKneadImages ( DOMDocument $doc ) : DOMDocument | ||
$doc | DOMDocument | |
Результат | DOMDocument |
protected searchForMetaValue ( $meta_key, array $postmeta ) : string | ||
$postmeta | array | |
Результат | string | meta field value |
public setCurrentImportOption ( array $upload ) : boolean | ||
$upload | array | |
Результат | boolean |
protected bool $isPbWxr | ||
Результат | boolean |