Ver Fonte

Seedlet: Fix Theme Review bugs (#2285)

* Fix package name, missed escapes, and variable prefixing.

* Remove accidental commit of experimental link color commenting out.

* Remove a line to trigger a diff.

* Remove second translation function.

* Rename menu variable.

* Update theme URI.

* Prefix global message variable.
Jeff Ong há 5 anos atrás
pai
commit
3f93343a9d

+ 1 - 2
seedlet/404.php

@@ -4,8 +4,7 @@
  *
  * @link https://codex.wordpress.org/Creating_an_Error_404_Page
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/archive.php

@@ -4,8 +4,7 @@
  *
  * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 1
seedlet/assets/css/ie.css

@@ -1,6 +1,6 @@
 /*
 Theme Name: Seedlet
-Theme URI: https://github.com/Automattic/themes/seedlet
+Theme URI: https://github.com/Automattic/themes/tree/master/seedlet
 Author: Automattic
 Author URI: https://automattic.com/
 Description: A simple, text-driven, single-column theme.

+ 4 - 4
seedlet/assets/js/customizer-validate-wcag-color-contrast.js

@@ -1,8 +1,8 @@
 /**
  * @author Per Soderlind
  * @link https://github.com/soderlind/2016-customizer-demo
- * global wp, _validateWCAGColorContrastExports
- * global validateContrastText
+ * global wp, seedletValidateWCAGColorContrastExports
+ * global seedletValidateContrastText
  * exported validateWCAGColorContrast
 **/
 ( function( $, api, exports ) {
@@ -49,7 +49,7 @@
 			});
 
 			if ( failsWCAG ){
-				var validationWarning = new api.Notification( code, { message: validateContrastText, type: 'warning' } );
+				var validationWarning = new api.Notification( code, { message: seedletValidateContrastText, type: 'warning' } );
 				setTimeout( function(){
 					self.custom_colors_setting.notifications.add( code, validationWarning );
 				}, 400);
@@ -210,4 +210,4 @@
 
 	return self;
 
-} )( jQuery, wp.customize, _validateWCAGColorContrastExports );
+} )( jQuery, wp.customize, seedletValidateWCAGColorContrastExports );

+ 1 - 1
seedlet/assets/sass/style.scss

@@ -1,6 +1,6 @@
 /*
 Theme Name: Seedlet
-Theme URI: https://github.com/Automattic/themes/seedlet
+Theme URI: https://github.com/Automattic/themes/tree/master/seedlet
 Author: Automattic
 Author URI: https://automattic.com/
 Description: A simple, text-driven, single-column theme.

+ 4 - 5
seedlet/classes/class-seedlet-custom-colors.php

@@ -7,8 +7,7 @@
  * Each variable that needs to be updated is defined in the $seedlet_custom_color_variables array below.
  * A customizer setting is created for each color, and custom CSS-variables are enqueued in the front and back end.
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 
@@ -278,7 +277,7 @@ class Seedlet_Custom_Colors {
 	 * @link https://github.com/soderlind/2016-customizer-demo
 	 */
 	function on_customize_controls_enqueue_scripts() {
-		$handle = 'wcag-validate-customizer-color-contrast';
+		$handle = 'seedlet-wcag-validate-customizer-color-contrast';
 		$src    = get_template_directory_uri() . '/assets/js/customizer-validate-wcag-color-contrast.js';
 		$deps 	= [ 'customize-controls' ];
 
@@ -293,10 +292,10 @@ class Seedlet_Custom_Colors {
 		];
 
 		wp_enqueue_script( $handle, $src, $deps );
-		wp_script_add_data( $handle, 'data', sprintf( 'var _validateWCAGColorContrastExports = %s;', wp_json_encode( $exports ) ) );
+		wp_script_add_data( $handle, 'data', sprintf( 'var seedletValidateWCAGColorContrastExports = %s;', wp_json_encode( $exports ) ) );
 
 		// Custom color contrast validation text
-		wp_localize_script( $handle, 'validateContrastText', esc_html__( 'This color combination may be hard for people to read. Try using a brighter background color and/or a darker foreground color.', 'seedlet' ));
+		wp_localize_script( $handle, 'seedletValidateContrastText', esc_html__( 'This color combination may be hard for people to read. Try using a brighter background color and/or a darker foreground color.', 'seedlet' ));
 	}
 
 	/**

+ 1 - 2
seedlet/classes/class-seedlet-svg-icons.php

@@ -2,8 +2,7 @@
 /**
  * SVG Icons class
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/footer.php

@@ -6,8 +6,7 @@
  *
  * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/functions.php

@@ -4,8 +4,7 @@
  *
  * @link https://developer.wordpress.org/themes/basics/theme-functions/
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 3 - 4
seedlet/header.php

@@ -6,8 +6,7 @@
  *
  * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 ?><!doctype html>
@@ -41,13 +40,13 @@
 					$location_name = 'primary';
 					$locations = get_nav_menu_locations();
 					$menu_id = $locations[ $location_name ];
-					$menu = wp_get_nav_menu_object( $menu_id );
+					$menu_obj = wp_get_nav_menu_object( $menu_id );
 
 					wp_nav_menu(
 						array(
 							'theme_location'  => 'primary',
 							'menu_class'      => 'menu-wrapper',
-							'container_class' => 'primary-menu-container menu-'. $menu->slug .'-container',
+							'container_class' => 'primary-menu-container menu-'. $menu_obj->slug .'-container',
 							'items_wrap'      => '<ul id="%1$s" class="%2$s" aria-label="' . esc_attr__( 'submenu', 'seedlet' ) . '">%3$s</ul>',
 						)
 					);

+ 1 - 2
seedlet/image.php

@@ -2,8 +2,7 @@
 /**
  * The template for displaying image attachments
  *
- * @package WordPress
- * @subpackage Varia
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/inc/back-compat.php

@@ -6,8 +6,7 @@
  * since this theme is not meant to be backward compatible beyond that and
  * relies on many newer functions and markup changes introduced in 4.7.
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since seedlet 1.0.0
  */
 

+ 1 - 2
seedlet/inc/block-patterns.php

@@ -2,8 +2,7 @@
 /**
  * Seedlet Theme: Block Patterns
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/inc/customizer.php

@@ -2,8 +2,7 @@
 /**
  * Seedlet Theme: Customizer
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/inc/icon-functions.php

@@ -2,8 +2,7 @@
 /**
  * SVG icons related functions
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/inc/template-functions.php

@@ -2,8 +2,7 @@
 /**
  * Functions which enhance the theme by hooking into WordPress
  *
- * @package WordPress
- * @subpackage Varia
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/inc/template-tags.php

@@ -2,8 +2,7 @@
 /**
  * Custom template tags for this theme
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 1
seedlet/inc/woocommerce.php

@@ -87,7 +87,7 @@ function seedlet_category_image() {
 		$thumbnail_id = get_term_meta( $cat->term_id, 'thumbnail_id', true );
 		$image = wp_get_attachment_url( $thumbnail_id );
 		if ( $image ) {
-			echo '<img src="' . $image . '" alt="' . $cat->name . '" />';
+			echo '<img src="' . esc_url( $image ) . '" alt="' . esc_attr( $cat->name ) . '" />';
 		}
 	}
 }

+ 1 - 2
seedlet/index.php

@@ -9,8 +9,7 @@
  *
  * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/page.php

@@ -4,8 +4,7 @@
  *
  * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/search.php

@@ -4,8 +4,7 @@
  *
  * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/single.php

@@ -4,8 +4,7 @@
  *
  * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 1
seedlet/style.css

@@ -1,6 +1,6 @@
 /*
 Theme Name: Seedlet
-Theme URI: https://github.com/Automattic/themes/seedlet
+Theme URI: https://github.com/Automattic/themes/tree/master/seedlet
 Author: Automattic
 Author URI: https://automattic.com/
 Description: A simple, text-driven, single-column theme.

+ 1 - 2
seedlet/template-parts/content/content-excerpt.php

@@ -4,8 +4,7 @@
  *
  * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/template-parts/content/content-none.php

@@ -4,8 +4,7 @@
  *
  * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/template-parts/content/content-page.php

@@ -4,8 +4,7 @@
  *
  * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/template-parts/content/content-single.php

@@ -4,8 +4,7 @@
  *
  * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/template-parts/content/content.php

@@ -4,8 +4,7 @@
  *
  * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/template-parts/footer/footer-widgets.php

@@ -2,8 +2,7 @@
 /**
  * Displays the footer widget area
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 

+ 1 - 2
seedlet/template-parts/header/entry-header.php

@@ -2,8 +2,7 @@
 /**
  * Displays the post header
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 ?>

+ 1 - 2
seedlet/template-parts/header/site-branding.php

@@ -2,8 +2,7 @@
 /**
  * Displays header site branding
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 ?>

+ 2 - 3
seedlet/template-parts/post/author-bio.php

@@ -2,15 +2,14 @@
 /**
  * The template for displaying Author info
  *
- * @package WordPress
- * @subpackage Seedlet
+ * @package Seedlet
  * @since 1.0.0
  */
 
 if ( (bool) get_the_author_meta( 'description' ) ) : ?>
 <div class="author-bio">
 	<?php
-	_e(__( 'Published by', 'seedlet' ));
+	_e( 'Published by', 'seedlet' );
 	?>
 	<h2 class="author-title">
 		<span class="author-heading">