Skip to content
wiki.fftac.org

Functions - Source Excerpt 02

Back to Functions

Summary

This source excerpt preserves a bounded section of Wiki.FFTAC.org/wp-content/themes/wiki-fftac-authority/functions.php so readers can inspect the evidence without opening the full source file.

**Source path:** Wiki.FFTAC.org/wp-content/themes/wiki-fftac-authority/functions.php

function aiwikis_authority_public_descriptions(): array {
	return array(
		'/'                         => 'wiki.fftac.org is the reviewed long-term memory and archive layer for 2IA.org, FFTAC.org, Anti-Christ.net, Antichrist.net, Anti-Christ.org, and Spiralist.org.',
		'/2ia-org/'                 => 'Reviewed long-term memory for 2IA.org, with source-site authority preserved at 2IA.org.',
		'/2ia-org/archive/'         => 'Archive and file-intake pointers for 2IA.org long-term memory.',
		'/2ia-org/file-intake-2026-05-16/' => 'Reviewed 2IA.org Improvement intake disposition, retaining high-level privacy literacy while blocking operational misuse guidance.',
		'/fftac-org/'               => 'Reviewed long-term memory for FFTAC.org, with source-site authority preserved at FFTAC.org.',
		'/fftac-org/archive/'       => 'Archive and file-intake pointers for FFTAC.org long-term memory.',
		'/anti-christ-net/'         => 'Reviewed long-term memory for Anti-Christ.net, with compact public-site source boundaries.',
		'/anti-christ-net/archive/' => 'Archive and file-intake pointers for Anti-Christ.net.',
		'/antichrist-net/'          => 'Reviewed long-term memory for Antichrist.net, with production package and content-system source boundaries.',
		'/antichrist-net/archive/'  => 'Archive and file-intake pointers for Antichrist.net.',
		'/anti-christ-org/'         => 'Reviewed long-term memory for Anti-Christ.org and its FFTAC publication system.',
		'/anti-christ-org/archive/' => 'Archive and file-intake pointers for Anti-Christ.org.',
		'/spiralist-org/'           => 'Reviewed long-term memory for Spiralist.org, including transferred archive memory.',
		'/spiralist-org/archive/'   => 'Archive and file-intake pointers for Spiralist.org.',
		'/start-here/'              => 'Task-first entry point for wiki.fftac.org reviewed memory and WP-FFTAC source boundaries.',
		'/search/'                  => 'Search reviewed wiki.fftac.org routes, source summaries, archive labels, and memory descriptions.',
		'/wp-fftac-memory-and-site-structure/' => 'Public map of the wiki.fftac.org memory layers, source-site boundaries, and deployment package rules.',
		'/memory/crawl-map/'        => 'Stable crawl path through WP-FFTAC source-site memory shelves.',
		'/memory/sources/'          => 'Reviewed source-file inventory for WP-FFTAC long-term memory.',
		'/for-ai-agents/'           => 'AI-agent navigation, discovery endpoints, and source-boundary guidance for wiki.fftac.org.',
		'/workspace-current-state/' => 'Current shared WP-FFTAC workspace status, boundaries, and deployment reminders.',
		'/transfer-log/'            => 'Transfer log for promoted long-term memory and archive imports into wiki.fftac.org.',
		'/browse/'                  => 'Browse 2IA.org, FFTAC.org, Anti-Christ.net, Antichrist.net, Anti-Christ.org, and Spiralist.org in one review surface.',
		'/browser/'                 => 'Browse 2IA.org, FFTAC.org, Anti-Christ.net, Antichrist.net, Anti-Christ.org, and Spiralist.org in one review surface.',
	);
}

function aiwikis_authority_current_description(): string {
	$path         = aiwikis_authority_current_public_path();
	$descriptions = aiwikis_authority_public_descriptions();

	if ( isset( $descriptions[ $path ] ) ) {
		return $descriptions[ $path ];
	}

	if ( is_singular() ) {
		$excerpt = get_the_excerpt();
		if ( is_string( $excerpt ) && ! aiwikis_authority_is_placeholder_text( $excerpt ) ) {
			return wp_strip_all_tags( $excerpt );
		}
	}

	$description = get_bloginfo( 'description' );
	if ( is_string( $description ) && ! aiwikis_authority_is_placeholder_text( $description ) ) {
		return wp_strip_all_tags( $description );
	}

	return aiwikis_authority_public_tagline();
}

function aiwikis_authority_current_title(): string {
	$path = aiwikis_authority_current_public_path();

	if ( '/' === $path || is_front_page() ) {
		return aiwikis_authority_public_site_name() . ' | WP-FFTAC Long-Term Memory';
	}

	if ( in_array( $path, array( '/browse/', '/browser/' ), true ) ) {
		return 'Workspace Site Browser | ' . aiwikis_authority_public_site_name();
	}

	if ( '/search/' === $path ) {
		return 'Search Reviewed Memory | ' . aiwikis_authority_public_site_name();
	}

	if ( is_search() ) {
		return 'wiki.fftac.org Search Results | WP-FFTAC Archive';
	}

	if ( is_singular() ) {
		$title = trim( wp_strip_all_tags( get_the_title() ) );

		if ( '' !== $title ) {
			return $title . ' | ' . aiwikis_authority_public_site_name();
		}
	}

	return aiwikis_authority_public_site_name() . ' | WP-FFTAC Archive';
}

function aiwikis_authority_filter_document_title( string $title ): string {
	unset( $title );

	return aiwikis_authority_current_title();
}

function aiwikis_authority_print_meta_description(): void {
	if ( is_admin() || is_feed() ) {
		return;
	}

	echo '<meta name="description" content="' . esc_attr( aiwikis_authority_current_description() ) . '">' . "\n";
}
add_action( 'wp_head', 'aiwikis_authority_print_meta_description', 2 );

function aiwikis_authority_current_public_url(): string {
	if ( is_search() ) {
		return add_query_arg( 's', get_search_query( false ), aiwikis_authority_public_url( '/' ) );
	}

	return aiwikis_authority_public_url( aiwikis_authority_current_public_path() );
}

function aiwikis_authority_print_canonical_link(): void {
	if ( is_admin() || is_feed() ) {
		return;
	}

	echo '<link rel="canonical" href="' . esc_url( aiwikis_authority_current_public_url() ) . '">' . "\n";
}
add_action( 'wp_head', 'aiwikis_authority_print_canonical_link', 3 );

function aiwikis_authority_send_theme_asset( string $relative_path, string $content_type ): void {
	$path = get_theme_file_path( ltrim( $relative_path, '/' ) );

	if ( ! is_readable( $path ) ) {
		return;
	}

	status_header( 200 );
	header( 'Content-Type: ' . $content_type );
	header( 'Cache-Control: public, max-age=604800' );
	header( 'Content-Length: ' . (string) filesize( $path ) );
	readfile( $path );
	exit;
}

function aiwikis_authority_serve_root_icon_request(): void {
	$request_path = isset( $_SERVER['REQUEST_URI'] ) ? (string) wp_parse_url( wp_unslash( $_SERVER['REQUEST_URI'] ), PHP_URL_PATH ) : '';

	if ( '/favicon.ico' === $request_path ) {
		aiwikis_authority_send_theme_asset( 'assets/images/favicon.ico', 'image/x-icon' );
	}

	if ( '/apple-touch-icon.png' === $request_path || '/apple-touch-icon-precomposed.png' === $request_path ) {
		aiwikis_authority_send_theme_asset( 'assets/images/apple-touch-icon.png', 'image/png' );
	}
}

function aiwikis_authority_serve_faviconico(): void {
	aiwikis_authority_send_theme_asset( 'assets/images/favicon.ico', 'image/x-icon' );
}

function aiwikis_authority_print_icon_links(): void {
	printf(
		'<link rel="icon" href="%s" sizes="any">' . "\n",
		esc_url( aiwikis_authority_public_url( '/favicon.ico' ) )
	);
	printf(
		'<link rel="shortcut icon" href="%s">' . "\n",
		esc_url( aiwikis_authority_public_url( '/favicon.ico' ) )
	);
	printf(
		'<link rel="icon" href="%s" type="image/png" sizes="32x32">' . "\n",
		esc_url( get_theme_file_uri( 'assets/images/favicon-32.png' ) )
	);
	printf(
		'<link rel="icon" href="%s" type="image/png" sizes="48x48">' . "\n",
		esc_url( get_theme_file_uri( 'assets/images/favicon-48.png' ) )
	);
	printf(
		'<link rel="apple-touch-icon" href="%s">' . "\n",
		esc_url( aiwikis_authority_public_url( '/apple-touch-icon.png' ) )
	);
}
add_action( 'wp_head', 'aiwikis_authority_print_icon_links', 1 );

function aiwikis_authority_print_social_meta(): void {
	if ( is_admin() || is_feed() ) {
		return;
	}

	$path        = aiwikis_authority_current_public_path();
	$url         = aiwikis_authority_current_public_url();
	$title       = aiwikis_authority_current_title();
	$description = aiwikis_authority_current_description();
	$image       = aiwikis_authority_public_url( '/wp-content/themes/aiwikis-authority/assets/images/aiwikis-social-share.png' );
	$type        = is_singular() ? 'article' : 'website';