Skip to content
wiki.fftac.org

Functions - Source Excerpt 03

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

echo '<meta property="og:site_name" content="' . esc_attr( aiwikis_authority_public_site_name() ) . '">' . "\n";
	echo '<meta property="og:type" content="' . esc_attr( $type ) . '">' . "\n";
	echo '<meta property="og:title" content="' . esc_attr( $title ) . '">' . "\n";
	echo '<meta property="og:description" content="' . esc_attr( $description ) . '">' . "\n";
	echo '<meta property="og:url" content="' . esc_url( $url ) . '">' . "\n";
	echo '<meta property="og:image" content="' . esc_url( $image ) . '">' . "\n";
	echo '<meta property="og:image:secure_url" content="' . esc_url( $image ) . '">' . "\n";
	echo '<meta property="og:image:width" content="1200">' . "\n";
	echo '<meta property="og:image:height" content="630">' . "\n";
	echo '<meta property="og:image:type" content="image/png">' . "\n";
	echo '<meta property="og:image:alt" content="wiki.fftac.org archive mark">' . "\n";
	echo '<meta name="twitter:card" content="summary_large_image">' . "\n";
	echo '<meta name="twitter:title" content="' . esc_attr( $title ) . '">' . "\n";
	echo '<meta name="twitter:description" content="' . esc_attr( $description ) . '">' . "\n";
	echo '<meta name="twitter:image" content="' . esc_url( $image ) . '">' . "\n";
	echo '<meta name="twitter:image:alt" content="wiki.fftac.org archive mark">' . "\n";
}
add_action( 'wp_head', 'aiwikis_authority_print_social_meta', 5 );

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

	$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' );
	$logo        = aiwikis_authority_public_url( '/wp-content/themes/aiwikis-authority/assets/images/aiwikis-app-icon-512.png' );
	$topics      = array(
		'WP-FFTAC',
		'2IA.org',
		'FFTAC.org',
		'Anti-Christ.net',
		'Antichrist.net',
		'Anti-Christ.org',
		'Spiralist.org',
		'long-term memory',
		'archive',
		'Project Handoff',
	);
	$topic_graph = array_map(
		static function ( string $topic ): array {
			return array(
				'@type' => 'Thing',
				'name'  => $topic,
			);
		},
		$topics
	);
	$image_object = array(
		'@type'          => 'ImageObject',
		'url'            => $image,
		'contentUrl'     => $image,
		'width'          => 1200,
		'height'         => 630,
		'encodingFormat' => 'image/png',
		'caption'        => 'wiki.fftac.org archive mark',
		'description'    => 'wiki.fftac.org archive mark',
	);
	$data         = array(
		'@context' => 'https://schema.org',
		'@graph'   => array(
			array(
				'@type'       => 'Organization',
				'@id'         => aiwikis_authority_public_url( '/#organization' ),
				'name'        => aiwikis_authority_public_site_name(),
				'url'         => aiwikis_authority_public_url( '/' ),
				'description' => aiwikis_authority_public_tagline(),
				'logo'        => array(
					'@type'          => 'ImageObject',
					'url'            => $logo,
					'contentUrl'     => $logo,
					'width'          => 512,
					'height'         => 512,
					'encodingFormat' => 'image/png',
				),
				'knowsAbout'  => $topics,
			),
			array(
				'@type'           => 'WebSite',
				'@id'             => aiwikis_authority_public_url( '/#website' ),
				'name'            => aiwikis_authority_public_site_name(),
				'url'             => aiwikis_authority_public_url( '/' ),
				'description'     => aiwikis_authority_current_description(),
				'about'           => $topic_graph,
				'publisher'       => array( '@id' => aiwikis_authority_public_url( '/#organization' ) ),
				'inLanguage'      => 'en-US',
				'potentialAction' => array(
					'@type'       => 'SearchAction',
					'target'      => aiwikis_authority_public_url( '/?s={search_term_string}' ),
					'query-input' => 'required name=search_term_string',
				),
			),
			array(
				'@type'               => is_singular() ? 'TechArticle' : 'WebPage',
				'@id'                 => $url . '#webpage',
				'url'                 => $url,
				'name'                => $title,
				'description'         => $description,
				'about'               => $topic_graph,
				'keywords'            => implode( ', ', $topics ),
				'isPartOf'            => array( '@id' => aiwikis_authority_public_url( '/#website' ) ),
				'inLanguage'          => 'en-US',
				'isAccessibleForFree' => true,
				'primaryImageOfPage'  => $image_object,
				'thumbnailUrl'        => $image,
				'image'               => array( $image_object ),
			),
		),
	);

	echo '<script type="application/ld+json">' . wp_json_encode( $data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ) . '</script>' . "\n";
}
add_action( 'wp_head', 'aiwikis_authority_print_json_ld', 6 );

function aiwikis_authority_register_patterns(): void {
	if ( function_exists( 'register_block_pattern_category' ) ) {
		register_block_pattern_category(
			'wiki.fftac.org',
			array( 'label' => __( 'wiki.fftac.org', 'aiwikis-authority' ) )
		);
	}
}
add_action( 'init', 'aiwikis_authority_register_patterns' );

function aiwikis_authority_workspace_sites(): array {
	return array(
		array(
			'name'  => '2IA.org',
			'url'   => 'https://2ia.org/',
			'role'  => 'Privacy-first public-intelligence and civil-liberties research site about communications surveillance, metadata, identity, AI analysis, false positives, and lawful public understanding.',
			'links' => array(
				'Long-term memory' => '/2ia-org/',
				'Archive'          => '/2ia-org/archive/',
				'Source files'     => '/2ia-org/source-files/',
				'Intake review'    => '/2ia-org/file-intake-2026-05-16/',
			),
		),
		array(
			'name'  => 'FFTAC.org',
			'url'   => 'https://fftac.org/',
			'role'  => 'Foundation public information site and primary public doorway into the WP-FFTAC network.',
			'links' => array(
				'Long-term memory' => '/fftac-org/',
				'Archive'          => '/fftac-org/archive/',
			),
		),
		array(
			'name'  => 'Anti-Christ.net',
			'url'   => 'https://anti-christ.net/',
			'role'  => 'Compact public FFTAC access site with its own long-term memory and archive trail.',
			'links' => array(
				'Long-term memory' => '/anti-christ-net/',
				'Archive'          => '/anti-christ-net/archive/',
			),
		),
		array(
			'name'  => 'Antichrist.net',
			'url'   => 'https://antichrist.net/',
			'role'  => 'Production WordPress archive, analysis, community research, and membership surface.',
			'links' => array(
				'Long-term memory' => '/antichrist-net/',
				'Archive'          => '/antichrist-net/archive/',
				'Source files'     => '/antichrist-net/source-files/',
			),
		),
		array(
			'name'  => 'Anti-Christ.org',
			'url'   => 'https://anti-christ.org/',
			'role'  => 'Foundation For The Anti-Christ publication system and official record theme surface.',
			'links' => array(
				'Long-term memory' => '/anti-christ-org/',
				'Archive'          => '/anti-christ-org/archive/',
			),
		),
		array(
			'name'  => 'Spiralist.org',
			'url'   => 'https://spiralist.org/',
			'role'  => 'Spiralist public site with transferred long-term memory and archive records.',
			'links' => array(
				'Long-term memory' => '/spiralist-org/',
				'Archive'          => '/spiralist-org/archive/',
			),
		),
	);
}

function aiwikis_authority_is_browse_request(): bool {
	if ( get_query_var( 'aiwikis_browse' ) ) {
		return true;
	}

	$request_path = isset( $_SERVER['REQUEST_URI'] ) ? (string) wp_parse_url( wp_unslash( $_SERVER['REQUEST_URI'] ), PHP_URL_PATH ) : '';
	$request_path = '/' . trim( strtolower( $request_path ), '/' ) . '/';

	return in_array( $request_path, array( '/browse/', '/browser/' ), true );
}

function aiwikis_authority_add_browse_rewrite(): void {
	add_rewrite_rule( '^browse/?$', 'index.php?aiwikis_browse=1', 'top' );
	add_rewrite_rule( '^browser/?$', 'index.php?aiwikis_browse=1', 'top' );
}
add_action( 'init', 'aiwikis_authority_add_browse_rewrite' );

function aiwikis_authority_add_browse_query_var( array $vars ): array {
	$vars[] = 'aiwikis_browse';

	return $vars;
}
add_filter( 'query_vars', 'aiwikis_authority_add_browse_query_var' );

function aiwikis_authority_render_site_link_list(): void {
	echo '<ul class="aiwikis-site-link-list">';
	foreach ( aiwikis_authority_workspace_sites() as $site ) {
		$links      = isset( $site['links'] ) && is_array( $site['links'] ) ? $site['links'] : array();
		$memory_url = isset( $links['Long-term memory'] ) ? (string) $links['Long-term memory'] : '/';
		echo '<li><a href="' . esc_url( home_url( $memory_url ) ) . '">' . esc_html( $site['name'] ) . '</a></li>';
	}
	echo '</ul>';
}

function aiwikis_authority_render_site_actions( array $site ): void {
	$label = isset( $site['name'] ) ? (string) $site['name'] : '';
	$links = isset( $site['links'] ) && is_array( $site['links'] ) ? $site['links'] : array();

	echo '<nav class="aiwikis-browse-actions" aria-label="' . esc_attr( $label . ' links' ) . '">';