function addFrontMatterByType($type, $contents)
{
$page_options = array('suppress' => 'on');
foreach ($contents as $index => $page) {
// If we hit non front-matter post types we won't see anymore front-matter
if ('front-matter' != $page['post_type']) {
return;
}
if (\Pressbooks\Taxonomy::getFrontMatterType($page['ID']) == $type) {
$page['mpdf_omit_toc'] = true;
$this->addPage($page, $page_options, false, false);
}
}
}