PressBooks\Modules\Import\Import::getChapterParent PHP Метод

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

Get a valid Part id to act as post_parent to a Chapter
protected getChapterParent ( ) : integer
Результат integer
    protected function getChapterParent()
    {
        $q = new \WP_Query();
        $args = array('post_type' => 'part', 'post_status' => 'publish', 'posts_per_page' => 1, 'orderby' => 'menu_order', 'order' => 'ASC', 'no_found_rows' => true);
        $results = $q->query($args);
        return absint($results[0]->ID);
    }