PressBooks\Modules\Import\Odf\Odt::kneadAndInsert PHP Метод

kneadAndInsert() защищенный Метод

Pummel then insert HTML into our database
protected kneadAndInsert ( string $html, string $title, string $post_type, integer $chapter_parent )
$html string
$title string
$post_type string (front-matter', 'chapter', 'back-matter')
$chapter_parent integer
    protected function kneadAndInsert($html, $title, $post_type, $chapter_parent)
    {
        $body = $this->tidy($html);
        $body = $this->kneadHTML($body);
        $title = wp_strip_all_tags($title);
        $new_post = array('post_title' => $title, 'post_content' => $body, 'post_type' => $post_type, 'post_status' => 'draft');
        if ('chapter' == $post_type) {
            $new_post['post_parent'] = $chapter_parent;
        }
        $pid = wp_insert_post(add_magic_quotes($new_post));
        update_post_meta($pid, 'pb_show_title', 'on');
        update_post_meta($pid, 'pb_export', 'on');
        Book::consolidatePost($pid, get_post($pid));
        // Reorder
    }