wp-content/themes/twentytwenty/inc/template-tags.php:34Displays the site logo, either text or image.
$argsarrayoptionalarray()$displaybooloptionaltruestring2 hooks fire while twentytwenty_site_logo() runs, in this order:
Filters the arguments for `twentytwenty_site_logo()`.
Filters the arguments for `twentytwenty_site_logo()`.
function twentytwenty_site_logo( $args = array(), $display = true ) { $logo = get_custom_logo(); $site_title = get_bloginfo( 'name' ); $contents = ''; $classname = ''; $defaults = array( 'logo' => '%1$s<span class="screen-reader-text">%2$s</span>', 'logo_class' => 'site-logo', 'title' => '<a href="%1$s">%2$s</a>', 'title_class' => 'site-title', 'home_wrap' => '<h1 class="%1$s">%2$s</h1>', 'single_wrap' => '<div class="%1$s faux-heading">%2$s</div>', 'condition' => ( is_front_page() || is_home() ) && ! is_page(), ); $args = wp_parse_args( $args, $defaults ); /** * Filters the arguments for `twentytwenty_site_logo()`. * * @since Twenty Twenty 1.0 * * @param array $args Parsed arguments. * @param array $defaults Function's default arguments. */ $args = apply_filters( 'twentytwenty_site_logo_args', $args, $defaults ); if ( has_custom_logo() ) { $contents = sprintf( $args['logo'], $logo, esc_html( $site_title ) ); $classname = $args['logo_class']; } else { $contents = sprintf( $args['title'], esc_url( get_home_url( null, '/' ) ), esc_html( $site_title ) ); $classname = $args['title_class']; } $wrap = $args['condition'] ? 'home_wrap' : 'single_wrap'; $html = sprintf( $args[ $wrap ], $classname, $contents ); /** * Filters the arguments for `twentytwenty_site_logo()`. * * @since Twenty Twenty 1.0 * * @param string $html Compiled HTML based on our arguments. * @param array $args Parsed arguments. * @param string $classname Class name based on current view, home or single. * @param string $contents HTML for site title or logo. */ $html = apply_filters( 'twentytwenty_site_logo', $html, $args, $classname, $contents ); if ( ! $display ) { return $html; } echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped}Introduced in Twenty Twenty 1.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
string to string|void.verified against sourcesrc/wp-content/themes/twentytwenty/inc/template-tags.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.