Skip to content
wiki.fftac.org

Functions - Source Excerpt 04

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

foreach ( $links as $link_label => $link_url ) {
		if ( preg_match( '#^https?://#i', (string) $link_url ) ) {
			continue;
		}

		echo '<a href="' . esc_url( home_url( (string) $link_url ) ) . '">' . esc_html( (string) $link_label ) . '</a>';
	}

	echo '</nav>';
}

function aiwikis_authority_render_browse_page(): void {
	if ( ! aiwikis_authority_is_browse_request() ) {
		return;
	}

	status_header( 200 );
	get_header();
	?>
	<main id="main" class="aiwikis-main aiwikis-browse-page">
		<section class="aiwikis-article aiwikis-browse-hero">
			<p class="aiwikis-kicker"><?php esc_html_e( 'WP-FFTAC review', 'aiwikis-authority' ); ?></p>
			<h1><?php esc_html_e( 'Workspace Site Browser', 'aiwikis-authority' ); ?></h1>
			<p class="aiwikis-lede"><?php esc_html_e( 'Review 2IA.org, FFTAC.org, Anti-Christ.net, Antichrist.net, Anti-Christ.org, and Spiralist.org with direct links to each site, long-term memory page, and archive page.', 'aiwikis-authority' ); ?></p>
			<?php aiwikis_authority_render_site_link_list(); ?>
		</section>
		<section class="aiwikis-browse-stack" aria-label="<?php esc_attr_e( 'Framed site previews', 'aiwikis-authority' ); ?>">
			<?php foreach ( aiwikis_authority_workspace_sites() as $site ) : ?>
				<article id="<?php echo esc_attr( sanitize_title( $site['name'] ) ); ?>" class="aiwikis-browse-frame">
					<header>
						<div>
							<h2><?php echo esc_html( $site['name'] ); ?></h2>
							<p><?php echo esc_html( $site['role'] ); ?></p>
						</div>
						<?php aiwikis_authority_render_site_actions( $site ); ?>
					</header>
				</article>
			<?php endforeach; ?>
		</section>
		<section class="aiwikis-article aiwikis-browse-links" aria-label="<?php esc_attr_e( 'Site links', 'aiwikis-authority' ); ?>">
			<h2><?php esc_html_e( 'Direct links', 'aiwikis-authority' ); ?></h2>
			<?php aiwikis_authority_render_site_link_list(); ?>
		</section>
	</main>
	<?php
	get_footer();
	exit;
}
add_action( 'template_redirect', 'aiwikis_authority_render_browse_page', -100 );

function aiwikis_authority_browse_shortcode(): string {
	ob_start();
	?>
	<section class="aiwikis-browse-hero">
		<p class="aiwikis-kicker"><?php esc_html_e( 'WP-FFTAC review', 'aiwikis-authority' ); ?></p>
		<p class="aiwikis-lede"><?php esc_html_e( 'Review 2IA.org, FFTAC.org, Anti-Christ.net, Antichrist.net, Anti-Christ.org, and Spiralist.org with direct links to each site, long-term memory page, and archive page.', 'aiwikis-authority' ); ?></p>
		<?php aiwikis_authority_render_site_link_list(); ?>
	</section>
	<section class="aiwikis-browse-stack" aria-label="<?php esc_attr_e( 'Framed site previews', 'aiwikis-authority' ); ?>">
		<?php foreach ( aiwikis_authority_workspace_sites() as $site ) : ?>
			<article id="<?php echo esc_attr( sanitize_title( $site['name'] ) ); ?>" class="aiwikis-browse-frame">
				<header>
					<div>
						<h2><?php echo esc_html( $site['name'] ); ?></h2>
						<p><?php echo esc_html( $site['role'] ); ?></p>
					</div>
					<?php aiwikis_authority_render_site_actions( $site ); ?>
				</header>
			</article>
		<?php endforeach; ?>
	</section>
	<section class="aiwikis-browse-links" aria-label="<?php esc_attr_e( 'Site links', 'aiwikis-authority' ); ?>">
		<h2><?php esc_html_e( 'Direct links', 'aiwikis-authority' ); ?></h2>
		<?php aiwikis_authority_render_site_link_list(); ?>
	</section>
	<?php
	return (string) ob_get_clean();
}
add_shortcode( 'aiwikis_browse', 'aiwikis_authority_browse_shortcode' );