Skip to content

Commit

Permalink
Make 2024: Add local nav pattern
Browse files Browse the repository at this point in the history
See #363


git-svn-id: https://meta.svn.wordpress.org/sites/trunk@14030 74240141-8908-4e6f-9713-ba540dce6ec7
  • Loading branch information
Adam Wood committed Sep 9, 2024
1 parent 5e30ad8 commit 0f9be02
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
ob_start();
do_action('wporg_breathe_before_name', 'front');
$team_icon = ob_get_clean();

if ( function_exists( 'register_block_pattern' ) ) {
register_block_pattern(
'wporg-breathe/local-nav',
array(
'title' => __( 'Local Nav', 'wporg-breathe' ),
'content' => sprintf(
'<!-- wp:wporg/local-navigation-bar {"className":"has-display-contents","backgroundColor":"charcoal-2","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"},":hover":{"color":{"text":"var:preset|color|white"}}}}},"textColor":"white","fontSize":"small"} -->
<!-- wp:paragraph {"fontSize":"small"} -->
<p class="wp-block-site-title has-small-font-size"><a href="%1$s">%2$s %3$s</a></p>
<!-- /wp:paragraph -->
<!-- wp:navigation {"icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small","menuSlug":"breathe"} /-->
<!-- /wp:wporg/local-navigation-bar -->',
esc_url( home_url() ),
$team_icon,
esc_html( get_bloginfo('name') )
),
)
);
}

0 comments on commit 0f9be02

Please sign in to comment.