['fcn_story', 'fcn_chapter', 'fcn_recommendation', 'post'] ) ); $skip_author_keywords = count( $all_authors ) > FICTIONEER_AUTHOR_KEYWORD_SEARCH_LIMIT; $queried_authors_in = sanitize_text_field( $_GET['authors'] ?? 0 ); $queried_authors_out = sanitize_text_field( $_GET['ex_authors'] ?? 0 ); $author_name = sanitize_text_field( $_GET['author_name'] ?? 0 ); // Simple text field $all_tags = get_tags(); $all_genres = get_tags( array( 'taxonomy' => 'fcn_genre' ) ); $all_fandoms = get_tags( array( 'taxonomy' => 'fcn_fandom' ) ); $all_characters = get_tags( array( 'taxonomy' => 'fcn_character' ) ); $all_warnings = get_tags( array( 'taxonomy' => 'fcn_content_warning' ) ); $queried_genres = sanitize_text_field( $_GET['genres'] ?? 0 ); $queried_fandoms = sanitize_text_field( $_GET['fandoms'] ?? 0 ); $queried_characters = sanitize_text_field( $_GET['characters'] ?? 0 ); $queried_warnings = sanitize_text_field( $_GET['warnings'] ?? 0 ); $queried_tags = sanitize_text_field( $_GET['tags'] ?? 0 ); $queried_ex_genres = sanitize_text_field( $_GET['ex_genres'] ?? 0 ); $queried_ex_fandoms = sanitize_text_field( $_GET['ex_fandoms'] ?? 0 ); $queried_ex_characters = sanitize_text_field( $_GET['ex_characters'] ?? 0 ); $queried_ex_warnings = sanitize_text_field( $_GET['ex_warnings'] ?? 0 ); $queried_ex_tags = sanitize_text_field( $_GET['ex_tags'] ?? 0 ); $is_advanced_search = $post_type != 'any' || $sentence != '0' || $order != 'desc' || $orderby != 'modified' || $queried_tags || $queried_genres || $queried_fandoms || $queried_characters || $queried_warnings || $queried_ex_tags || $queried_ex_genres || $queried_ex_fandoms || $queried_ex_characters || $queried_ex_warnings || $queried_authors_in || $queried_authors_out || $author_name || $story_status; // Prime author cache if ( function_exists( 'update_post_author_caches' ) ) { update_post_author_caches( $all_authors ); } // Prepare data JSONs $all_terms = array_merge( $all_tags, $all_genres, $all_fandoms, $all_characters, $all_warnings ); $allow_list = []; foreach ( $all_terms as $term ) { $allow_list[ rawurlencode( strtolower( $term->name ) ) ] = $term->term_id; } if ( ! $skip_author_keywords ) { foreach ( $all_authors as $author ) { $allow_list[ rawurlencode( strtolower( $author->display_name ) ) ] = $author->ID; } } } ?>