'; include $logo_path; echo ''; return; } // Fallback to text $site_name = get_bloginfo( 'name' ); echo ''; } /** * Get hero title from Customizer. * * @return string Hero title text. */ function peptide_starter_get_hero_title() { return get_theme_mod( 'hero_title', esc_html__( 'Is this peptide right for you?', 'peptide-starter' ) ); } /** * Get hero subtitle from Customizer. * * @return string Hero subtitle text. */ function peptide_starter_get_hero_subtitle() { return get_theme_mod( 'hero_subtitle', esc_html__( 'What the research really says', 'peptide-starter' ) ); } /** * Get search placeholder from Customizer. * * @return string Search placeholder text. */ function peptide_starter_get_search_placeholder() { return get_theme_mod( 'hero_search_placeholder', esc_html__( 'Search peptides, sequences, or research...', 'peptide-starter' ) ); } /** * Get footer copyright text from Customizer. * * @return string Copyright text (may contain safe HTML). */ function peptide_starter_get_footer_copyright() { return get_theme_mod( 'footer_copyright', esc_html__( 'Copyright \u00a9 2026 Peptide Repo. All rights reserved.', 'peptide-starter' ) ); } /** * Whether to render the newsletter signup section. Filterable. * * @return bool */ function peptide_starter_show_newsletter_form() { return apply_filters( 'peptide_starter_show_newsletter', true ); } /** * Render pagination for archive pages. * * @return void */ function peptide_starter_pagination() { global $wp_query; if ( $wp_query->max_num_pages <= 1 ) { return; } $current = max( 1, get_query_var( 'paged' ) ); $total = $wp_query->max_num_pages; echo ''; } /** * Whether a plugin is active by its main file path. * * @param string $plugin Plugin file path relative to plugins/. * @return bool */ function peptide_starter_is_plugin_active( $plugin ) { return in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ); } /** * Safe wp_get_referer fallback — never returns empty. * * @return string Referer or home_url('/'). */ function peptide_starter_safe_referer() { $ref = wp_get_referer(); return $ref ? $ref : home_url( '/' ); } /** * Gate a template behind login + verified email. * * Unauthenticated \u2192 redirect to /auth?redirect_to=current-uri. * Logged in but unverified \u2192 redirect to /profile?verify_required=1. * * Side effects: emits 302 and exits the request. * * @param string|null $redirect_to Optional override for post-login target. * @return void */ function peptide_starter_require_login( $redirect_to = null ) { if ( ! is_user_logged_in() ) { $target = $redirect_to ? $redirect_to : ( isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '/' ); wp_safe_redirect( home_url( '/auth?redirect_to=' . rawurlencode( $target ) ) ); exit; } if ( function_exists( 'peptide_starter_user_is_verified' ) && ! peptide_starter_user_is_verified( get_current_user_id() ) ) { wp_safe_redirect( home_url( '/profile?verify_required=1' ) ); exit; } } /** * Render a honeypot input block for a given form. * * Pair with peptide_starter_honeypot_triggered() in the handler. * * @param string $form_name Short slug embedded in the field name. * @return void Echoes HTML. */ function peptide_starter_render_honeypot( $form_name ) { $field = 'ps_hp_' . preg_replace( '/[^a-z0-9_]/', '', $form_name ); ?>