瀏覽代碼

Merge pull request #2874 from Automattic/fix/spearhead-themesniffer-issues

Spearhead: fix themesniffer issues for dotorg submission
Jeff Ong 4 年之前
父節點
當前提交
0bdb5bfe6b
共有 3 個文件被更改,包括 27 次插入26 次删除
  1. 3 3
      spearhead/functions.php
  2. 23 22
      spearhead/header.php
  3. 1 1
      spearhead/template-parts/content/content-excerpt.php

+ 3 - 3
spearhead/functions.php

@@ -149,9 +149,9 @@ add_action( 'enqueue_block_assets', 'spearhead_block_extends' );
 /**
 /**
  * Add Google webfonts
  * Add Google webfonts
  *
  *
- * @return string
+ * @return value
  */
  */
-function spearhead_fonts_url() : string {
+function spearhead_fonts_url() {
 	$fonts_url = '';
 	$fonts_url = '';
 
 
 	$font_families   = array();
 	$font_families   = array();
@@ -168,7 +168,7 @@ function spearhead_fonts_url() : string {
 /**
 /**
  * Load extras
  * Load extras
  */
  */
-function seedlet_entry_meta_header() : void {
+function seedlet_entry_meta_header() {
 	// Hide author, post date, category and tag text for pages.
 	// Hide author, post date, category and tag text for pages.
 	if ( 'post' === get_post_type() ) {
 	if ( 'post' === get_post_type() ) {
 		// Posted on
 		// Posted on

+ 23 - 22
spearhead/header.php

@@ -26,16 +26,16 @@ $header_classes .= $has_primary_nav ? ' has-menu' : '';
 <body <?php body_class(); ?>>
 <body <?php body_class(); ?>>
 <?php wp_body_open(); ?>
 <?php wp_body_open(); ?>
 <div id="page" class="site">
 <div id="page" class="site">
-	<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'seedlet' ); ?></a>
+	<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'spearhead' ); ?></a>
 
 
 		<header id="masthead" class="<?php echo $header_classes; ?>" role="banner">
 		<header id="masthead" class="<?php echo $header_classes; ?>" role="banner">
 			<?php get_template_part( 'template-parts/header/site-branding' ); ?>
 			<?php get_template_part( 'template-parts/header/site-branding' ); ?>
 
 
 			<?php if ( $has_primary_nav || has_nav_menu( 'social' ) ) : ?>
 			<?php if ( $has_primary_nav || has_nav_menu( 'social' ) ) : ?>
-				<nav id="site-navigation" class="primary-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Main', 'seedlet' ); ?>">
+				<nav id="site-navigation" class="primary-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Main', 'spearhead' ); ?>">
 					<button id="primary-close-menu" class="button close">
 					<button id="primary-close-menu" class="button close">
-						<span class="dropdown-icon close"><?php _e( 'Close', 'seedlet' ); ?> <?php echo seedlet_get_icon_svg( 'close' ); ?></span>
-						<span class="hide-visually collapsed-text"><?php _e( 'collapsed', 'seedlet' ); ?></span>
+						<span class="dropdown-icon close"><?php _e( 'Close', 'spearhead' ); ?> <?php echo seedlet_get_icon_svg( 'close' ); ?></span>
+						<span class="hide-visually collapsed-text"><?php _e( 'collapsed', 'spearhead' ); ?></span>
 					</button>
 					</button>
 					<div class="extra-navigation-wrapper">
 					<div class="extra-navigation-wrapper">
 						<?php
 						<?php
@@ -58,13 +58,14 @@ $header_classes .= $has_primary_nav ? ' has-menu' : '';
 						if ( has_nav_menu( 'social' ) ) :
 						if ( has_nav_menu( 'social' ) ) :
 							wp_nav_menu(
 							wp_nav_menu(
 								array(
 								array(
-									'theme_location'  => 'social',
-									'link_before'     => '<span class="screen-reader-text">',
-									'link_after'      => '</span>' . seedlet_get_icon_svg( 'link' ),
-									'container_class' => 'social-navigation',
-									'depth'           => 1,
-								)
-							);
+									'theme_location' => 'social',
+									'link_before'    => '<span class="screen-reader-text">',
+									'link_after'     => '</span>' . seedlet_get_icon_svg(
+										'link',
+										'container_class' => 'social-navigation',
+										'depth'           => 1
+									),
+								);
 						endif;
 						endif;
 						?>
 						?>
 					</div><!-- .extra-navigation-wrapper -->
 					</div><!-- .extra-navigation-wrapper -->
@@ -74,14 +75,14 @@ $header_classes .= $has_primary_nav ? ' has-menu' : '';
 			<div class="menu-button-container">
 			<div class="menu-button-container">
 				<?php if ( $has_primary_nav ) : ?>
 				<?php if ( $has_primary_nav ) : ?>
 					<button id="primary-open-menu" class="button open">
 					<button id="primary-open-menu" class="button open">
-						<span class="dropdown-icon open"><?php _e( 'Menu', 'seedlet' ); ?> <?php echo seedlet_get_icon_svg( 'menu' ); ?></span>
-						<span class="hide-visually expanded-text"><?php _e( 'expanded', 'seedlet' ); ?></span>
+						<span class="dropdown-icon open"><?php _e( 'Menu', 'spearhead' ); ?> <?php echo seedlet_get_icon_svg( 'menu' ); ?></span>
+						<span class="hide-visually expanded-text"><?php _e( 'expanded', 'spearhead' ); ?></span>
 					</button>
 					</button>
 				<?php endif; ?>
 				<?php endif; ?>
 			</div>
 			</div>
 
 
 			<?php if ( class_exists( 'WooCommerce' ) ) : ?>
 			<?php if ( class_exists( 'WooCommerce' ) ) : ?>
-				<nav class="woo-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Woo Minicart', 'seedlet' ); ?>">
+				<nav class="woo-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Woo Minicart', 'spearhead' ); ?>">
 					<?php
 					<?php
 					echo( sprintf(
 					echo( sprintf(
 						'<button id="woo-close-menu" class="button close">
 						'<button id="woo-close-menu" class="button close">
@@ -98,14 +99,14 @@ $header_classes .= $has_primary_nav ? ' has-menu' : '';
 									</li>
 									</li>
 								</ul>
 								</ul>
 							</li>',
 							</li>',
-						esc_html__( 'Close', 'seedlet' ),
+						esc_html__( 'Close', 'spearhead' ),
 						seedlet_get_icon_svg( 'close' ),
 						seedlet_get_icon_svg( 'close' ),
-						esc_html__( 'collapsed', 'seedlet' ),
+						esc_html__( 'collapsed', 'spearhead' ),
 						is_cart() ? 'current-menu-item' : '',
 						is_cart() ? 'current-menu-item' : '',
-						esc_attr__( 'View your shopping cart', 'seedlet' ),
-						seedlet_cart_link(),
-						esc_attr__( 'View your shopping list', 'seedlet' ),
-						seedlet_cart_widget()
+						esc_attr__( 'View your shopping cart', 'spearhead' ),
+						spearhead_cart_link(),
+						esc_attr__( 'View your shopping list', 'spearhead' ),
+						spearhead_cart_widget()
 					) );
 					) );
 					?>
 					?>
 				</nav><!-- .woo-navigation -->
 				</nav><!-- .woo-navigation -->
@@ -114,8 +115,8 @@ $header_classes .= $has_primary_nav ? ' has-menu' : '';
 			<div class="menu-button-container">
 			<div class="menu-button-container">
 				<?php if ( class_exists( 'WooCommerce' ) ) : ?>
 				<?php if ( class_exists( 'WooCommerce' ) ) : ?>
 					<button id="woo-open-menu" class="button open">
 					<button id="woo-open-menu" class="button open">
-						<span class="dropdown-icon open"><?php echo seedlet_get_icon_svg( 'shopping_cart' ); ?> <?php _e( 'Cart', 'seedlet' ); ?></span>
-						<span class="hide-visually expanded-text"><?php esc_html__( 'expanded', 'seedlet' ); ?></span>
+						<span class="dropdown-icon open"><?php echo seedlet_get_icon_svg( 'shopping_cart' ); ?> <?php _e( 'Cart', 'spearhead' ); ?></span>
+						<span class="hide-visually expanded-text"><?php esc_html__( 'expanded', 'spearhead' ); ?></span>
 					</button>
 					</button>
 				<?php endif; ?>
 				<?php endif; ?>
 			</div>
 			</div>

+ 1 - 1
spearhead/template-parts/content/content-excerpt.php

@@ -14,7 +14,7 @@
 	<header class="entry-header default-max-width">
 	<header class="entry-header default-max-width">
 		<?php
 		<?php
 		if ( is_sticky() && is_home() && ! is_paged() ) {
 		if ( is_sticky() && is_home() && ! is_paged() ) {
-			printf( '<span class="sticky-post">%s</span>', _x( 'Featured', 'post', 'seedlet' ) );
+			printf( '<span class="sticky-post">%s</span>', _x( 'Featured', 'post', 'spearhead' ) );
 		}
 		}
 		the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
 		the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
 		?>
 		?>