inc.php 980 Bytes
<?php

require_once 'class-wp-bootstrap-navwalker.php';
require_once 'hooks-filters.php';
require_once 'breadcrumb.php';
require_once 'shortcodes.php';
require_once 'search-extras.php';
require_once 'disable-comments.php';
require_once 'blocks.php';
require_once 'widgets-area.php';
require_once 'commands.php';
require_once 'rest.php';



function get_global_excluded_posts() {

    $all_cats = get_categories();
    $excluded = [];

    foreach($all_cats as $cat) {

        $main_index_page = get_field('main_index_page', $cat);

        if($main_index_page) {

            $excluded[] = $main_index_page->ID;

        }

    }

    return $excluded;

}

function get_for_excluded_cats() {

    $all_cats = get_categories();
    $excluded = [];

    foreach($all_cats as $cat) {

        $latest_exclusive = get_field('exclude_from_latest_articles', $cat);

        if($latest_exclusive) {

            $excluded[] = $cat->term_id;

        }

    }

    return $excluded;

}