Skip to content
wiki.fftac.org

Foundation - Source Excerpt 05

Back to Foundation

Summary

This source excerpt preserves a bounded section of Anti-Christ.org/wp-content/plugins/fftac-foundation-core/inc/foundation.php so readers can inspect the evidence without opening the full source file.

**Source path:** Anti-Christ.org/wp-content/plugins/fftac-foundation-core/inc/foundation.php

'summary' => __('Dedicated reading routes, recurring case files, and symbolic lexicon entries that turn two once-generic pages into launch-ready interpretive labs.', 'antichrist-engine'),
            'items'   => $interpretive_items,
        );
    }

    $research_record_items = antichrist_engine_foundation_get_research_record_sitemap_items();

    if ($research_record_items) {
        $sections[] = array(
            'id'      => 'research-records',
            'eyebrow' => __('Record Desk', 'antichrist-engine'),
            'title'   => __('Focused atlas records', 'antichrist-engine'),
            'summary' => __('Query-based public record views for briefings, timeline entries, claim dossiers, and source files that now live as first-class launch surfaces.', 'antichrist-engine'),
            'items'   => $research_record_items,
        );
    }

    $series_items = array();
    foreach (antichrist_engine_foundation_publication_series() as $slug => $track) {
        $series_items[] = array(
            'title'   => (string) ($track['name'] ?? $slug),
            'summary' => (string) ($track['description'] ?? ''),
            'url'     => add_query_arg('track', $slug, antichrist_engine_foundation_get_page_url('journal')),
            'meta'    => (string) ($track['classification'] ?? __('Journal track', 'antichrist-engine')),
        );
    }

    if ($series_items) {
        $sections[] = array(
            'id'      => 'journal-tracks',
            'eyebrow' => __('Journal', 'antichrist-engine'),
            'title'   => __('Publication tracks', 'antichrist-engine'),
            'summary' => __('Archive routes for verified dossiers, historical files, algorithmic eschatology, and short-form briefings.', 'antichrist-engine'),
            'items'   => $series_items,
        );
    }

    $publication_route_items = array();

    foreach (antichrist_engine_foundation_publication_release_desk() as $route) {
        $publication_route_items[] = array(
            'title'   => (string) ($route['title'] ?? __('Publication route', 'antichrist-engine')),
            'summary' => (string) ($route['summary'] ?? ''),
            'url'     => antichrist_engine_foundation_build_target_url(
                (string) ($route['target'] ?? ''),
                (array) ($route['args'] ?? array()),
                (string) ($route['anchor'] ?? '')
            ),
            'meta'    => trim(implode(' / ', array_filter(array(
                $route['eyebrow'] ?? __('Release desk', 'antichrist-engine'),
                $route['best_for'] ?? '',
            )))),
        );
    }

    foreach (antichrist_engine_foundation_publication_route_packets() as $packet) {
        $publication_route_items[] = array(
            'title'   => (string) ($packet['title'] ?? __('Publication packet', 'antichrist-engine')),
            'summary' => (string) ($packet['summary'] ?? ''),
            'url'     => antichrist_engine_foundation_build_target_url(
                (string) ($packet['primary_target'] ?? ''),
                (array) ($packet['primary_args'] ?? array()),
                (string) ($packet['primary_anchor'] ?? '')
            ),
            'meta'    => trim(implode(' / ', array_filter(array(
                $packet['eyebrow'] ?? __('Publication packet', 'antichrist-engine'),
                $packet['note'] ?? '',
            )))),
        );
    }

    if ($publication_route_items) {
        $sections[] = array(
            'id'      => 'publication-routing',
            'eyebrow' => __('Release Desk', 'antichrist-engine'),
            'title'   => __('Publication routes and packets', 'antichrist-engine'),
            'summary' => __('Newsroom-style release roles and packeted reading routes for readers who know the journal use case before they know the exact file title.', 'antichrist-engine'),
            'items'   => $publication_route_items,
        );
    }

    $program_items = array();
    foreach (antichrist_engine_foundation_program_interest_options() as $slug => $program) {
        $program_items[] = array(
            'title'   => (string) ($program['label'] ?? $slug),
            'summary' => (string) ($program['description'] ?? ''),
            'url'     => antichrist_engine_foundation_build_target_url('join', array('program' => $slug), 'program-intake'),
            'meta'    => implode(' / ', array_filter(array(
                $program['format'] ?? '',
                $program['cadence'] ?? '',
            ))),
        );
    }

    $program_items[] = array(
        'title'   => __('Program readiness desk', 'antichrist-engine'),
        'summary' => __('Fit signals, preparation notes, and route maps that help readers choose the right lane before they submit an intake note.', 'antichrist-engine'),
        'url'     => antichrist_engine_foundation_build_target_url('join', array(), 'program-readiness'),
        'meta'    => __('Join / readiness', 'antichrist-engine'),
    );

    $program_items[] = array(
        'title'   => __('Member workflow', 'antichrist-engine'),
        'summary' => __('Protected continuity for profile management, draft routing, cohort follow-up, and program coordination inside the membership portal.', 'antichrist-engine'),
        'url'     => antichrist_engine_foundation_build_target_url('membership_portal', array(), 'member-workflow'),
        'meta'    => __('Portal / protected workflow', 'antichrist-engine'),
    );

    if ($program_items) {
        $sections[] = array(
            'id'      => 'participation-lanes',
            'eyebrow' => __('Participation', 'antichrist-engine'),
            'title'   => __('Programs and intake lanes', 'antichrist-engine'),
            'summary' => __('Public routes into cohorts, summits, contributor work, and academic affiliate review.', 'antichrist-engine'),
            'items'   => $program_items,
        );
    }

    $feed_items = antichrist_engine_foundation_get_machine_readable_route_items();

    $sections[] = array(
        'id'      => 'feeds-and-exports',
        'eyebrow' => __('Feeds', 'antichrist-engine'),
        'title'   => __('Machine-readable discovery and export routes', 'antichrist-engine'),
        'summary' => __('Crawler maps, JSON endpoints, and generated file downloads for researchers, citations, prototypes, and indexing tools.', 'antichrist-engine'),
        'items'   => $feed_items,
    );

    $recent_items = array();
    foreach (get_posts(antichrist_engine_foundation_get_publication_query_args(array(
        'posts_per_page' => 6,
    ))) as $post) {
        if (!$post instanceof WP_Post || antichrist_engine_foundation_is_placeholder_publication($post)) {
            continue;
        }

        $series    = antichrist_engine_post_series($post->ID);
        $record_id = antichrist_engine_post_record_id($post->ID);
        $summary   = has_excerpt($post) ? $post->post_excerpt : wp_trim_words(wp_strip_all_tags($post->post_content), 20);

        $recent_items[] = array(
            'title'   => (string) $post->post_title,
            'summary' => (string) $summary,
            'url'     => get_permalink($post),
            'meta'    => implode(' / ', array_filter(array(
                $series['name'] ?? '',
                $record_id,
            ))),
        );
    }

    if ($recent_items) {
        $sections[] = array(
            'id'      => 'recent-publications',
            'eyebrow' => __('Archive', 'antichrist-engine'),
            'title'   => __('Recent journal publications', 'antichrist-engine'),
            'summary' => __('Latest public files preserved in the live archive while the broader journal continues to expand.', 'antichrist-engine'),
            'items'   => $recent_items,
        );
    }

    return $sections;
}

/**
 * Normalizes text for theme-level search matching.
 *
 * @param string $text Raw text.
 * @return string
 */
function antichrist_engine_foundation_normalize_search_text($text)
{
    $text = remove_accents((string) $text);
    $text = wp_strip_all_tags($text);
    $text = preg_replace('/\s+/', ' ', $text);

    return strtolower(trim((string) $text));
}

/**
 * Splits a search query into normalized terms.
 *
 * @param string $query Raw search query.
 * @return array<int, string>
 */
function antichrist_engine_foundation_get_search_terms($query)
{
    $normalized = antichrist_engine_foundation_normalize_search_text($query);

    if ('' === $normalized) {
        return array();
    }

    return array_values(array_filter(explode(' ', $normalized)));
}

/**
 * Gets the public search URL, optionally seeded with a query.
 *
 * @param string $query Optional query string.
 * @return string
 */
function antichrist_engine_foundation_get_search_url($query = '')
{
    $url = home_url('/');