function genesis_seo_site_title() { // Set what goes inside the wrapping tags. $inside = current_theme_supports( 'genesis-custom-logo' ) && has_custom_logo() ? wp_kses_post( get_bloginfo( 'name' ) ) : wp_kses_post( sprintf( '<a href="%s">%s</a>', trailingslashit( home_url() ), get_bloginfo( 'name' ) ) ); // Determine which wrapping tags to use. $wrap = genesis_is_root_page() && 'title' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p'; // Fallback for static homepage if an SEO plugin is active. $wrap = genesis_is_root_page() && genesis_seo_disabled() ? 'p' : $wrap; // Fallback for latest posts if an SEO plugin is active. $wrap = is_front_page() && is_home() && genesis_seo_disabled() ? 'h1' : $wrap; // And finally, $wrap in h1 if HTML5 & semantic headings enabled. $wrap = genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap; /** * Site title wrapping element * * The wrapping element for the site title. * * @since 2.2.3 * * @param string $wrap The wrapping element (h1, h2, p, etc.). */ $wrap = apply_filters( 'genesis_site_title_wrap', $wrap ); // Build the title. $title = genesis_markup( [ 'open' => sprintf( "<{$wrap} %s>", genesis_attr( 'site-title' ) ), 'close' => "</{$wrap}>", 'content' => $inside, 'context' => 'site-title', 'echo' => false, 'params' => [ 'wrap' => $wrap, ], ] ); /** * The SEO title filter * * Allows the entire SEO title to be filtered. * * @since ??? * * @param string $title The SEO title. * @param string $inside The inner portion of the SEO title. * @param string $wrap The html element to wrap the title in. */ $title = apply_filters( 'genesis_seo_title', $title, $inside, $wrap ); echo $title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- sanitize done prior to filter application }