From afaa27411ee63076088ca5229b3a91e99923c11d Mon Sep 17 00:00:00 2001 From: laurelfulford Date: Wed, 28 Jun 2017 11:36:57 -0700 Subject: [PATCH 01/18] Adding a Pull Request Template, to help make sure information is included with PRs. --- .github/PULL_REQUEST_TEMPLATE.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..fdae1feb --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,6 @@ + + +#### Changes proposed in this Pull Request: + + +#### Related issue(s): \ No newline at end of file From 8e67439859c713ed543b6f416fb59d2556f41735 Mon Sep 17 00:00:00 2001 From: Dmitry Mayorov Date: Mon, 7 Dec 2015 12:02:25 -0500 Subject: [PATCH 02/18] Add comment navigation template tags --- comments.php | 25 +--- languages/_s.pot | 325 ++++++++++++++++++++--------------------------- 2 files changed, 138 insertions(+), 212 deletions(-) diff --git a/comments.php b/comments.php index 3e2d27c9..c6c69345 100644 --- a/comments.php +++ b/comments.php @@ -45,17 +45,7 @@ if ( post_password_required() ) { ?> - 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> - - +
- 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> - - \n" +"X-Generator: grunt-wp-i18n 0.5.4\n" #: 404.php:17 -#@ _s msgid "Oops! That page can’t be found." msgstr "" #: 404.php:21 -#@ _s -msgid "It looks like nothing was found at this location. Maybe try one of the links below or a search?" +msgid "" +"It looks like nothing was found at this location. Maybe try one of the " +"links below or a search?" msgstr "" -#: 404.php:33 -#@ _s +#: 404.php:30 msgid "Most Used Categories" msgstr "" +#: 404.php:47 #. translators: %1$s: smiley -#: 404.php:51 -#, php-format -#@ _s msgid "Try looking in the monthly archives. %1$s" msgstr "" -#. translators: 1: title. #: comments.php:34 -#, php-format -#@ _s +#. translators: 1: title. msgid "One thought on “%1$s”" msgstr "" -#. translators: 1: comment count number, 2: title. +#: comments.php:67 +msgid "Comments are closed." +msgstr "" + +#: footer.php:18 +msgid "https://wordpress.org/" +msgstr "" + +#: footer.php:20 +#. translators: %s: CMS name, i.e. WordPress. +msgid "Proudly powered by %s" +msgstr "" + +#: footer.php:25 +#. translators: 1: Theme name, 2: Theme author. +msgid "Theme: %1$s by %2$s." +msgstr "" + +#: functions.php:47 +msgid "Primary" +msgstr "" + +#: functions.php:105 +msgid "Sidebar" +msgstr "" + +#: functions.php:107 +msgid "Add widgets here." +msgstr "" + +#: header.php:24 +msgid "Skip to content" +msgstr "" + +#: header.php:45 +msgid "Primary Menu" +msgstr "" + +#: inc/template-tags.php:52 +#. translators: used between list items, there is a space after the comma +msgid ", " +msgstr "" + +#: inc/template-tags.php:55 +#. translators: 1: list of categories. +msgid "Posted in %1$s" +msgstr "" + +#: inc/template-tags.php:62 +#. translators: 1: list of tags. +msgid "Tagged %1$s" +msgstr "" + +#: inc/template-tags.php:72 +#. translators: %s: post title +msgid "Leave a Comment on %s" +msgstr "" + +#: inc/template-tags.php:89 template-parts/content-page.php:35 +#. translators: %s: Name of current post. Only visible to screen readers +msgid "Edit %s" +msgstr "" + +#: search.php:21 +#. translators: %s: search query. +msgid "Search Results for: %s" +msgstr "" + +#: template-parts/content-none.php:14 +msgid "Nothing Found" +msgstr "" + +#: template-parts/content-none.php:25 +#. translators: 1: link to WP admin new post page. +msgid "Ready to publish your first post? Get started here." +msgstr "" + +#: template-parts/content-none.php:38 +msgid "" +"Sorry, but nothing matched your search terms. Please try again with some " +"different keywords." +msgstr "" + +#: template-parts/content-none.php:44 +msgid "" +"It seems we can’t find what you’re looking for. Perhaps " +"searching can help." +msgstr "" + +#: template-parts/content-page.php:22 template-parts/content.php:45 +msgid "Pages:" +msgstr "" + +#: template-parts/content.php:34 +#. translators: %s: Name of current post. Only visible to screen readers +msgid "Continue reading \"%s\"" +msgstr "" + +#. Theme Name of the plugin/theme +msgid "_s" +msgstr "" + +#. Theme URI of the plugin/theme +msgid "http://underscores.me/" +msgstr "" + +#. Description of the plugin/theme +msgid "" +"Hi. I'm a starter theme called _s, or underscores, if " +"you like. I'm a theme meant for hacking so don't use me as a Parent " +"Theme. Instead try turning me into the next, most awesome, WordPress " +"theme out there. That's what I'm here for." +msgstr "" + +#. Author of the plugin/theme +msgid "Automattic" +msgstr "" + +#. Author URI of the plugin/theme +msgid "http://automattic.com/" +msgstr "" + #: comments.php:40 -#, php-format -#@ _s +#. translators: 1: comment count number, 2: title. msgctxt "comments title" msgid "%1$s thought on “%2$s”" msgid_plural "%1$s thoughts on “%2$s”" msgstr[0] "" msgstr[1] "" -#: comments.php:50 comments.php:71 -#@ _s -msgid "Comment navigation" -msgstr "" - -#: comments.php:53 comments.php:74 -#@ _s -msgid "Older Comments" -msgstr "" - -#: comments.php:54 comments.php:75 -#@ _s -msgid "Newer Comments" -msgstr "" - -#: comments.php:88 -#@ _s -msgid "Comments are closed." -msgstr "" - -#: footer.php:18 -#@ _s -msgid "https://wordpress.org/" -msgstr "" - -#. translators: %s: CMS name, i.e. WordPress. -#: footer.php:20 -#, php-format -#@ _s -msgid "Proudly powered by %s" -msgstr "" - -#. translators: 1: Theme name, 2: Theme author. -#: footer.php:25 -#, php-format -#@ _s -msgid "Theme: %1$s by %2$s." -msgstr "" - -#: functions.php:47 -#@ _s -msgid "Primary" -msgstr "" - -#: functions.php:93 -#@ _s -msgid "Sidebar" -msgstr "" - -#: functions.php:95 -#@ _s -msgid "Add widgets here." -msgstr "" - -#: header.php:24 -#@ _s -msgid "Skip to content" -msgstr "" - -#: header.php:44 -#@ _s -msgid "Primary Menu" -msgstr "" - -#. translators: %s: post date. #: inc/template-tags.php:29 -#, php-format -#@ _s +#. translators: %s: post date. msgctxt "post date" msgid "Posted on %s" msgstr "" -#. translators: %s: post author. #: inc/template-tags.php:35 -#, php-format -#@ _s +#. translators: %s: post author. msgctxt "post author" msgid "by %s" msgstr "" -#. translators: used between list items, there is a space after the comma -#: inc/template-tags.php:52 -#@ _s -msgid ", " -msgstr "" - -#. translators: 1: list of categories. -#: inc/template-tags.php:55 -#, php-format -#@ _s -msgid "Posted in %1$s" -msgstr "" - -#. translators: used between list items, there is a space after the comma #: inc/template-tags.php:59 -#, php-format -#@ _s +#. translators: used between list items, there is a space after the comma msgctxt "list item separator" msgid ", " msgstr "" - -#. translators: 1: list of tags. -#: inc/template-tags.php:62 -msgid "Tagged %1$s" -msgstr "" - -#. translators: %s: post title -#: inc/template-tags.php:72 -#, php-format -#@ _s -msgid "Leave a Comment on %s" -msgstr "" - -#. translators: %s: Name of current post. Only visible to screen readers -#: inc/template-tags.php:89 template-parts/content-page.php:35 -#, php-format -#@ _s -msgid "Edit %s" -msgstr "" - -#. translators: %s: search query. -#: search.php:21 -#, php-format -#@ _s -msgid "Search Results for: %s" -msgstr "" - -#: template-parts/content-none.php:14 -#@ _s -msgid "Nothing Found" -msgstr "" - -#. translators: 1: link to WP admin new post page. -#: template-parts/content-none.php:25 -#, php-format -#@ _s -msgid "Ready to publish your first post? Get started here." -msgstr "" - -#: template-parts/content-none.php:38 -#@ _s -msgid "Sorry, but nothing matched your search terms. Please try again with some different keywords." -msgstr "" - -#: template-parts/content-none.php:44 -#@ _s -msgid "It seems we can’t find what you’re looking for. Perhaps searching can help." -msgstr "" - -#@ _s -#: template-parts/content-page.php:22 template-parts/content.php:45 -msgid "Pages:" -msgstr "" - -#. translators: %s: Name of current post. Only visible to screen readers -#: template-parts/content.php:34 -#, php-format -#@ _s -msgid "Continue reading \"%s\"" -msgstr "" - -#. Theme Name of the plugin/theme -#@ _s -msgid "_s" -msgstr "" - -#. Theme URI of the plugin/theme -#@ _s -msgid "http://underscores.me/" -msgstr "" - -#. Description of the plugin/theme -#@ _s -msgid "Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for." -msgstr "" - -#. Author of the plugin/theme -#@ _s -msgid "Automattic" -msgstr "" - -#. Author URI of the plugin/theme -#@ _s -msgid "http://automattic.com/" -msgstr "" From 6e5adc24bbdc092cba1671ad0f0aa71c437a684a Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Sat, 1 Jul 2017 10:22:22 +0700 Subject: [PATCH 03/18] Trim white space in a blank line --- phpcs.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 59ed5d08..c75e45ec 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -18,7 +18,7 @@ - + . From fdcbbdab44d999f5481ccd6d28cc58422ff9ada0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rie=20Blanchard?= Date: Thu, 29 Jun 2017 01:43:22 +0200 Subject: [PATCH 04/18] use ampersand in the loop to have .gallery-item in good position --- sass/media/_galleries.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass/media/_galleries.scss b/sass/media/_galleries.scss index 7499e078..c3801ab2 100644 --- a/sass/media/_galleries.scss +++ b/sass/media/_galleries.scss @@ -10,7 +10,7 @@ // Loops to enumerate the classes for gallery columns. @for $i from 2 through 9 { - .gallery-columns-#{$i} { + .gallery-columns-#{$i} & { max-width: ( 100% / $i ); } } From a3739e969b32b85e63fab1aa09bc5f85f14081ae Mon Sep 17 00:00:00 2001 From: mrwweb Date: Thu, 6 Jul 2017 11:26:00 -0700 Subject: [PATCH 05/18] allow for content-{post_type}.php template files in single.php --- single.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/single.php b/single.php index 4f058f73..b17f8a29 100644 --- a/single.php +++ b/single.php @@ -15,7 +15,7 @@ get_header(); ?> Date: Sat, 8 Jul 2017 04:41:38 +0530 Subject: [PATCH 06/18] Replace underscore with hyphen (#1163) Fixes #1160 --- inc/customizer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/customizer.php b/inc/customizer.php index 783d9551..190c3d9f 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -50,6 +50,6 @@ function _s_customize_partial_blogdescription() { * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function _s_customize_preview_js() { - wp_enqueue_script( '_s_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); + wp_enqueue_script( '_s-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); } add_action( 'customize_preview_init', '_s_customize_preview_js' ); From b65478e278671efca158afc69e5266685b3063c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Sat, 8 Jul 2017 01:18:44 +0200 Subject: [PATCH 07/18] Make README instruction numbering consistent (#1156) --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0e06c38c..20627c6a 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,11 @@ If you want to set things up manually, download `_s` from GitHub. The first thin OR -* Search for: `'_s'` and replace with: `'megatherium-is-awesome'` -* Search for: `_s_` and replace with: `megatherium_is_awesome_` -* Search for: `Text Domain: _s` and replace with: `Text Domain: megatherium-is-awesome` in style.css. -* Search for:  _s and replace with:  Megatherium_is_Awesome -* Search for: `_s-` and replace with: `megatherium-is-awesome-` +1. Search for: `'_s'` and replace with: `'megatherium-is-awesome'` +2. Search for: `_s_` and replace with: `megatherium_is_awesome_` +3. Search for: `Text Domain: _s` and replace with: `Text Domain: megatherium-is-awesome` in style.css. +4. Search for:  _s and replace with:  Megatherium_is_Awesome +5. Search for: `_s-` and replace with: `megatherium-is-awesome-` Then, update the stylesheet header in `style.css` and the links in `footer.php` with your own information. Next, update or delete this readme. From 19da01c40ded505b7491f0c0bc84da3f73bd04fd Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Sat, 8 Jul 2017 11:16:16 +0200 Subject: [PATCH 08/18] Move CONTRIBUTING.md to .github --- CONTRIBUTING.md => .github/CONTRIBUTING.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename CONTRIBUTING.md => .github/CONTRIBUTING.md (100%) diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md From 32a9dbd5d5557b7614f3bf6e2ea059adbcc925a2 Mon Sep 17 00:00:00 2001 From: Bappi Date: Mon, 10 Jul 2017 09:33:38 +0600 Subject: [PATCH 09/18] Proper Indentation Metas and Links within Head should be indented as it is a common practice --- header.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/header.php b/header.php index ef0fa423..8f020723 100644 --- a/header.php +++ b/header.php @@ -9,14 +9,15 @@ * @package _s */ -?> +?> + > - - - + + + - + > From 34ab8ea00fa12f31c150a0307e37083035b4f37f Mon Sep 17 00:00:00 2001 From: Jasper de Groot Date: Fri, 14 Jul 2017 17:52:14 +0200 Subject: [PATCH 10/18] Remove superfluous check from comment template (#935) --- comments.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/comments.php b/comments.php index c6c69345..f378e3d8 100644 --- a/comments.php +++ b/comments.php @@ -58,16 +58,14 @@ if ( post_password_required() ) { +

+ - -

- From 4a2e99e6915ae93c380317f9149a74c767ea85c2 Mon Sep 17 00:00:00 2001 From: Juliette Date: Fri, 14 Jul 2017 18:37:12 +0200 Subject: [PATCH 11/18] Conditionally include Jetpack compatibility file. (#858) Only include the Jetpack file if Jetpack is available on a site --- functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 4c52b386..acf75f0b 100644 --- a/functions.php +++ b/functions.php @@ -152,4 +152,6 @@ require get_template_directory() . '/inc/customizer.php'; /** * Load Jetpack compatibility file. */ -require get_template_directory() . '/inc/jetpack.php'; +if ( defined( 'JETPACK__VERSION' ) ) { + require get_template_directory() . '/inc/jetpack.php'; +} From 40d4e1a350b6778f08b78bc352cde476842a153a Mon Sep 17 00:00:00 2001 From: "David A. Kennedy" Date: Fri, 14 Jul 2017 14:14:20 -0400 Subject: [PATCH 12/18] _s: Fix spacing in logo styles Fixes #1146 --- sass/media/_media.scss | 2 +- style.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sass/media/_media.scss b/sass/media/_media.scss index 0f2f32b2..21d83af2 100644 --- a/sass/media/_media.scss +++ b/sass/media/_media.scss @@ -15,7 +15,7 @@ object { } /* Make sure logo link wraps around logo image. */ -.custom-logo-link{ +.custom-logo-link { display: inline-block; } diff --git a/style.css b/style.css index c8362c0c..035a9676 100644 --- a/style.css +++ b/style.css @@ -818,7 +818,7 @@ object { } /* Make sure logo link wraps around logo image. */ -.custom-logo-link{ +.custom-logo-link { display: inline-block; } From fb31e675220940b7d6d7b77c9af1c555da9eb7f1 Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Sat, 15 Jul 2017 01:18:27 +0545 Subject: [PATCH 13/18] Add theme tags (#1181) _s: Add relevant theme tags Fixes #1147. --- readme.txt | 2 +- sass/style.scss | 2 +- style.css | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index 7c0a0b01..0beaaefd 100644 --- a/readme.txt +++ b/readme.txt @@ -1,7 +1,7 @@ === _s === Contributors: automattic -Tags: +Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready Requires at least: 4.0 Tested up to: 4.8 diff --git a/sass/style.scss b/sass/style.scss index 5aacd0cc..a53fef63 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -8,7 +8,7 @@ Version: 1.0.0 License: GNU General Public License v2 or later License URI: LICENSE Text Domain: _s -Tags: +Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready This theme, like WordPress, is licensed under the GPL. Use it to make something cool, have fun, and share what you've learned with others. diff --git a/style.css b/style.css index 035a9676..a4c8f096 100644 --- a/style.css +++ b/style.css @@ -8,7 +8,7 @@ Version: 1.0.0 License: GNU General Public License v2 or later License URI: LICENSE Text Domain: _s -Tags: +Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready This theme, like WordPress, is licensed under the GPL. Use it to make something cool, have fun, and share what you've learned with others. From 8eb93e96cfd3e6eb8d50614dcc4fa8aaaea3fb77 Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Mon, 17 Jul 2017 20:26:51 +0200 Subject: [PATCH 14/18] Clone specific PHPCS rulesets --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 03201ffc..4de30e58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,11 +47,11 @@ before_script: - export PHPCS_DIR=/tmp/phpcs - export SNIFFS_DIR=/tmp/sniffs # Install CodeSniffer for WordPress Coding Standards checks. - - if [[ "$SNIFF" == "1" ]]; then git clone -b 2.9 --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi + - if [[ "$SNIFF" == "1" ]]; then git clone -b 2.9.1 --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi # Install WordPress Coding Standards. - - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $SNIFFS_DIR; fi + - if [[ "$SNIFF" == "1" ]]; then git clone -b 0.11.0 --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $SNIFFS_DIR; fi # Install PHP Compatibility sniffs. - - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $SNIFFS_DIR/PHPCompatibility; fi + - if [[ "$SNIFF" == "1" ]]; then git clone -b 7.1.5 --depth 1 https://github.com/wimg/PHPCompatibility.git $SNIFFS_DIR/PHPCompatibility; fi # Set install path for PHPCS sniffs. # @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941 - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs --config-set installed_paths $SNIFFS_DIR; fi From 4e69e3ffe100a9846099be5deca175bf127c616f Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Tue, 18 Jul 2017 23:40:25 +0200 Subject: [PATCH 15/18] Use Ubuntu Trusty by default and Precise for PHP 5.2 Starting July 18th 2017, Travis will begin switching the default image to trusty, which does not support PHP 5.2 or 5.3. https://blog.travis-ci.com/2017-07-11-trusty-as-default-linux-is-coming --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 4de30e58..18a0ea73 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ # @link http://docs.travis-ci.com/user/migrating-from-legacy/#Why-migrate-to-container-based-infrastructure%3F # @link http://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure sudo: false +dist: trusty # Declare project language. # @link http://about.travis-ci.org/docs/user/languages/php/ @@ -22,6 +23,7 @@ matrix: # Current $required_php_version for WordPress: 5.2.4 # aliased to 5.2.17 - php: '5.2' + dist: precise # aliased to a recent 5.6.x version - php: '5.6' env: SNIFF=1 From 5ba1b9acb05141e0208ccbba17b35fe6e3536cf6 Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Sat, 1 Jul 2017 11:57:00 +0700 Subject: [PATCH 16/18] Add new line at the end of file and missing white space --- .jscsrc | 2 +- .jshintignore | 2 +- layouts/content-sidebar.css | 2 +- layouts/sidebar-content.css | 2 +- sass/elements/_elements.scss | 2 +- sass/elements/_lists.scss | 2 +- sass/elements/_tables.scss | 2 +- sass/forms/_buttons.scss | 2 +- sass/forms/_forms.scss | 2 +- sass/layout/_content-sidebar.scss | 2 +- sass/layout/_sidebar-content.scss | 2 +- sass/media/_media.scss | 2 +- sass/modules/_clearings.scss | 2 +- sass/modules/_infinite-scroll.scss | 2 +- sass/navigation/_links.scss | 2 +- sass/navigation/_navigation.scss | 2 +- sass/site/_site.scss | 2 +- sass/site/primary/_posts-and-pages.scss | 4 ++-- sass/typography/_copy.scss | 2 +- sass/typography/_headings.scss | 2 +- sass/typography/_typography.scss | 2 +- sass/variables-site/_structure.scss | 2 +- sass/variables-site/_typography.scss | 2 +- sass/variables-site/_variables-site.scss | 2 +- 24 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.jscsrc b/.jscsrc index 9a7bbb01..edf97acd 100644 --- a/.jscsrc +++ b/.jscsrc @@ -4,4 +4,4 @@ "excludeFiles": [ "js/**.min.js" ] -} \ No newline at end of file +} diff --git a/.jshintignore b/.jshintignore index 54162f6f..eef19b5c 100644 --- a/.jshintignore +++ b/.jshintignore @@ -1 +1 @@ -js/**.min.js \ No newline at end of file +js/**.min.js diff --git a/layouts/content-sidebar.css b/layouts/content-sidebar.css index 8505da68..1e25ae8b 100644 --- a/layouts/content-sidebar.css +++ b/layouts/content-sidebar.css @@ -22,4 +22,4 @@ .site-footer { clear: both; width: 100%; -} \ No newline at end of file +} diff --git a/layouts/sidebar-content.css b/layouts/sidebar-content.css index 41f738c4..66342d0f 100644 --- a/layouts/sidebar-content.css +++ b/layouts/sidebar-content.css @@ -22,4 +22,4 @@ .site-footer { clear: both; width: 100%; -} \ No newline at end of file +} diff --git a/sass/elements/_elements.scss b/sass/elements/_elements.scss index 4909ddc5..38f91c4a 100644 --- a/sass/elements/_elements.scss +++ b/sass/elements/_elements.scss @@ -39,4 +39,4 @@ figure { margin: 1em 0; /* Extra wide images within figure tags don't overflow the content area. */ } -@import "tables"; \ No newline at end of file +@import "tables"; diff --git a/sass/elements/_lists.scss b/sass/elements/_lists.scss index e271c24f..fcda0c11 100644 --- a/sass/elements/_lists.scss +++ b/sass/elements/_lists.scss @@ -22,4 +22,4 @@ dt { dd { margin: 0 1.5em 1.5em; -} \ No newline at end of file +} diff --git a/sass/elements/_tables.scss b/sass/elements/_tables.scss index 14af567a..acd5b337 100644 --- a/sass/elements/_tables.scss +++ b/sass/elements/_tables.scss @@ -1,4 +1,4 @@ table { margin: 0 0 1.5em; width: 100%; -} \ No newline at end of file +} diff --git a/sass/forms/_buttons.scss b/sass/forms/_buttons.scss index d7a914a6..cc54f951 100644 --- a/sass/forms/_buttons.scss +++ b/sass/forms/_buttons.scss @@ -19,4 +19,4 @@ input[type="submit"] { &:focus { border-color: $color__border-button-focus; } -} \ No newline at end of file +} diff --git a/sass/forms/_forms.scss b/sass/forms/_forms.scss index 8008a558..2036ef92 100644 --- a/sass/forms/_forms.scss +++ b/sass/forms/_forms.scss @@ -1,3 +1,3 @@ @import "buttons"; -@import "fields"; \ No newline at end of file +@import "fields"; diff --git a/sass/layout/_content-sidebar.scss b/sass/layout/_content-sidebar.scss index ecfdc7d4..2af13c9a 100644 --- a/sass/layout/_content-sidebar.scss +++ b/sass/layout/_content-sidebar.scss @@ -17,4 +17,4 @@ .site-footer { clear: both; width: $size__site-main; -} \ No newline at end of file +} diff --git a/sass/layout/_sidebar-content.scss b/sass/layout/_sidebar-content.scss index f101e3ec..03eb2d84 100644 --- a/sass/layout/_sidebar-content.scss +++ b/sass/layout/_sidebar-content.scss @@ -17,4 +17,4 @@ .site-footer { clear: both; width: $size__site-main; -} \ No newline at end of file +} diff --git a/sass/media/_media.scss b/sass/media/_media.scss index 21d83af2..b46086d6 100644 --- a/sass/media/_media.scss +++ b/sass/media/_media.scss @@ -27,4 +27,4 @@ object { /*-------------------------------------------------------------- ## Galleries --------------------------------------------------------------*/ -@import "galleries"; \ No newline at end of file +@import "galleries"; diff --git a/sass/modules/_clearings.scss b/sass/modules/_clearings.scss index 96c3245e..444b6b60 100644 --- a/sass/modules/_clearings.scss +++ b/sass/modules/_clearings.scss @@ -20,4 +20,4 @@ .site-content:after, .site-footer:after { @include clearfix-after; -} \ No newline at end of file +} diff --git a/sass/modules/_infinite-scroll.scss b/sass/modules/_infinite-scroll.scss index be51db2e..11721379 100644 --- a/sass/modules/_infinite-scroll.scss +++ b/sass/modules/_infinite-scroll.scss @@ -7,4 +7,4 @@ /* When Infinite Scroll has reached its end we need to re-display elements that were hidden (via .neverending) before. */ .infinity-end.neverending .site-footer { display: block; -} \ No newline at end of file +} diff --git a/sass/navigation/_links.scss b/sass/navigation/_links.scss index eade43f6..95a5b4d2 100644 --- a/sass/navigation/_links.scss +++ b/sass/navigation/_links.scss @@ -16,4 +16,4 @@ a { &:active { outline: 0; } -} \ No newline at end of file +} diff --git a/sass/navigation/_navigation.scss b/sass/navigation/_navigation.scss index ffa4368a..2e774b25 100644 --- a/sass/navigation/_navigation.scss +++ b/sass/navigation/_navigation.scss @@ -6,4 +6,4 @@ /*-------------------------------------------------------------- ## Menus --------------------------------------------------------------*/ -@import "menus"; \ No newline at end of file +@import "menus"; diff --git a/sass/site/_site.scss b/sass/site/_site.scss index 32571067..9e4b9db4 100644 --- a/sass/site/_site.scss +++ b/sass/site/_site.scss @@ -8,4 +8,4 @@ /*-------------------------------------------------------------- ## Comments --------------------------------------------------------------*/ -@import "primary/comments"; \ No newline at end of file +@import "primary/comments"; diff --git a/sass/site/primary/_posts-and-pages.scss b/sass/site/primary/_posts-and-pages.scss index 3329cfd6..ceed29f1 100644 --- a/sass/site/primary/_posts-and-pages.scss +++ b/sass/site/primary/_posts-and-pages.scss @@ -6,7 +6,7 @@ margin: 0 0 1.5em; } -.updated:not(.published){ +.updated:not(.published) { display: none; } @@ -19,4 +19,4 @@ .page-links { clear: both; margin: 0 0 1.5em; -} \ No newline at end of file +} diff --git a/sass/typography/_copy.scss b/sass/typography/_copy.scss index 82a10e3c..db7411f3 100644 --- a/sass/typography/_copy.scss +++ b/sass/typography/_copy.scss @@ -42,4 +42,4 @@ mark, ins { big { font-size: 125%; -} \ No newline at end of file +} diff --git a/sass/typography/_headings.scss b/sass/typography/_headings.scss index 281e6666..8333692d 100644 --- a/sass/typography/_headings.scss +++ b/sass/typography/_headings.scss @@ -1,3 +1,3 @@ h1, h2, h3, h4, h5, h6 { clear: both; -} \ No newline at end of file +} diff --git a/sass/typography/_typography.scss b/sass/typography/_typography.scss index 9450eb81..b25e6cc2 100644 --- a/sass/typography/_typography.scss +++ b/sass/typography/_typography.scss @@ -12,4 +12,4 @@ textarea { @import "headings"; -@import "copy"; \ No newline at end of file +@import "copy"; diff --git a/sass/variables-site/_structure.scss b/sass/variables-site/_structure.scss index adbf8892..d24a84ed 100644 --- a/sass/variables-site/_structure.scss +++ b/sass/variables-site/_structure.scss @@ -1,2 +1,2 @@ $size__site-main: 100%; -$size__site-sidebar: 25%; \ No newline at end of file +$size__site-sidebar: 25%; diff --git a/sass/variables-site/_typography.scss b/sass/variables-site/_typography.scss index 56ea1be6..302891ea 100644 --- a/sass/variables-site/_typography.scss +++ b/sass/variables-site/_typography.scss @@ -2,4 +2,4 @@ $font__main: sans-serif; $font__code: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; $font__pre: "Courier 10 Pitch", Courier, monospace; $font__line-height-body: 1.5; -$font__line-height-pre: 1.6; \ No newline at end of file +$font__line-height-pre: 1.6; diff --git a/sass/variables-site/_variables-site.scss b/sass/variables-site/_variables-site.scss index 661e342b..72ab8847 100644 --- a/sass/variables-site/_variables-site.scss +++ b/sass/variables-site/_variables-site.scss @@ -1,3 +1,3 @@ @import "colors"; @import "typography"; -@import "structure"; \ No newline at end of file +@import "structure"; From 6e75903248bcac8ad1ebc966e470d62886d87ada Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Mon, 24 Jul 2017 08:23:45 +0700 Subject: [PATCH 17/18] Update PHPCS ruleset to check coding standard for CSS and SCSS files --- phpcs.xml.dist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index c75e45ec..5a4ab66b 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -16,8 +16,8 @@ --> - - + + . From 9fcb8dab4069e72fbd9a76b465291bf3f2eaa3a3 Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Wed, 28 Jun 2017 08:27:25 +0700 Subject: [PATCH 18/18] Correct code indentation --- comments.php | 30 ++++----- functions.php | 138 +++++++++++++++++++-------------------- inc/custom-header.php | 72 ++++++++++----------- inc/template-tags.php | 146 +++++++++++++++++++++--------------------- 4 files changed, 193 insertions(+), 193 deletions(-) diff --git a/comments.php b/comments.php index f378e3d8..30b2e88b 100644 --- a/comments.php +++ b/comments.php @@ -27,21 +27,21 @@ if ( post_password_required() ) { if ( have_comments() ) : ?>

' . get_the_title() . '' - ); - } else { - printf( // WPCS: XSS OK. - /* translators: 1: comment count number, 2: title. */ - esc_html( _nx( '%1$s thought on “%2$s”', '%1$s thoughts on “%2$s”', $comment_count, 'comments title', '_s' ) ), - number_format_i18n( $comment_count ), - '' . get_the_title() . '' - ); - } + $comment_count = get_comments_number(); + if ( 1 === $comment_count ) { + printf( + /* translators: 1: title. */ + esc_html_e( 'One thought on “%1$s”', '_s' ), + '' . get_the_title() . '' + ); + } else { + printf( // WPCS: XSS OK. + /* translators: 1: comment count number, 2: title. */ + esc_html( _nx( '%1$s thought on “%2$s”', '%1$s thoughts on “%2$s”', $comment_count, 'comments title', '_s' ) ), + number_format_i18n( $comment_count ), + '' . get_the_title() . '' + ); + } ?>

diff --git a/functions.php b/functions.php index acf75f0b..76bac867 100644 --- a/functions.php +++ b/functions.php @@ -8,78 +8,78 @@ */ if ( ! function_exists( '_s_setup' ) ) : -/** - * Sets up theme defaults and registers support for various WordPress features. - * - * Note that this function is hooked into the after_setup_theme hook, which - * runs before the init hook. The init hook is too late for some features, such - * as indicating support for post thumbnails. - */ -function _s_setup() { - /* - * Make theme available for translation. - * Translations can be filed in the /languages/ directory. - * If you're building a theme based on _s, use a find and replace - * to change '_s' to the name of your theme in all the template files. - */ - load_theme_textdomain( '_s', get_template_directory() . '/languages' ); - - // Add default posts and comments RSS feed links to head. - add_theme_support( 'automatic-feed-links' ); - - /* - * Let WordPress manage the document title. - * By adding theme support, we declare that this theme does not use a - * hard-coded tag in the document head, and expect WordPress to - * provide it for us. - */ - add_theme_support( 'title-tag' ); - - /* - * Enable support for Post Thumbnails on posts and pages. - * - * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ - */ - add_theme_support( 'post-thumbnails' ); - - // This theme uses wp_nav_menu() in one location. - register_nav_menus( array( - 'menu-1' => esc_html__( 'Primary', '_s' ), - ) ); - - /* - * Switch default core markup for search form, comment form, and comments - * to output valid HTML5. - */ - add_theme_support( 'html5', array( - 'search-form', - 'comment-form', - 'comment-list', - 'gallery', - 'caption', - ) ); - - // Set up the WordPress core custom background feature. - add_theme_support( 'custom-background', apply_filters( '_s_custom_background_args', array( - 'default-color' => 'ffffff', - 'default-image' => '', - ) ) ); - - // Add theme support for selective refresh for widgets. - add_theme_support( 'customize-selective-refresh-widgets' ); - /** - * Add support for core custom logo. + * Sets up theme defaults and registers support for various WordPress features. * - * @link https://codex.wordpress.org/Theme_Logo + * Note that this function is hooked into the after_setup_theme hook, which + * runs before the init hook. The init hook is too late for some features, such + * as indicating support for post thumbnails. */ - add_theme_support( 'custom-logo', array( - 'height' => 250, - 'width' => 250, - 'flex-width' => true, - 'flex-height' => true, - ) ); -} + function _s_setup() { + /* + * Make theme available for translation. + * Translations can be filed in the /languages/ directory. + * If you're building a theme based on _s, use a find and replace + * to change '_s' to the name of your theme in all the template files. + */ + load_theme_textdomain( '_s', get_template_directory() . '/languages' ); + + // Add default posts and comments RSS feed links to head. + add_theme_support( 'automatic-feed-links' ); + + /* + * Let WordPress manage the document title. + * By adding theme support, we declare that this theme does not use a + * hard-coded <title> tag in the document head, and expect WordPress to + * provide it for us. + */ + add_theme_support( 'title-tag' ); + + /* + * Enable support for Post Thumbnails on posts and pages. + * + * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ + */ + add_theme_support( 'post-thumbnails' ); + + // This theme uses wp_nav_menu() in one location. + register_nav_menus( array( + 'menu-1' => esc_html__( 'Primary', '_s' ), + ) ); + + /* + * Switch default core markup for search form, comment form, and comments + * to output valid HTML5. + */ + add_theme_support( 'html5', array( + 'search-form', + 'comment-form', + 'comment-list', + 'gallery', + 'caption', + ) ); + + // Set up the WordPress core custom background feature. + add_theme_support( 'custom-background', apply_filters( '_s_custom_background_args', array( + 'default-color' => 'ffffff', + 'default-image' => '', + ) ) ); + + // Add theme support for selective refresh for widgets. + add_theme_support( 'customize-selective-refresh-widgets' ); + + /** + * Add support for core custom logo. + * + * @link https://codex.wordpress.org/Theme_Logo + */ + add_theme_support( 'custom-logo', array( + 'height' => 250, + 'width' => 250, + 'flex-width' => true, + 'flex-height' => true, + ) ); + } endif; add_action( 'after_setup_theme', '_s_setup' ); diff --git a/inc/custom-header.php b/inc/custom-header.php index 134f1077..97b1db28 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -29,44 +29,44 @@ function _s_custom_header_setup() { add_action( 'after_setup_theme', '_s_custom_header_setup' ); if ( ! function_exists( '_s_header_style' ) ) : -/** - * Styles the header image and text displayed on the blog. - * - * @see _s_custom_header_setup(). - */ -function _s_header_style() { - $header_text_color = get_header_textcolor(); - - /* - * If no custom options for text are set, let's bail. - * get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: add_theme_support( 'custom-header' ). + /** + * Styles the header image and text displayed on the blog. + * + * @see _s_custom_header_setup(). */ - if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { - return; - } + function _s_header_style() { + $header_text_color = get_header_textcolor(); - // If we get this far, we have custom styles. Let's do this. - ?> - <style type="text/css"> - <?php + /* + * If no custom options for text are set, let's bail. + * get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: add_theme_support( 'custom-header' ). + */ + if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { + return; + } + + // If we get this far, we have custom styles. Let's do this. + ?> + <style type="text/css"> + <?php // Has the text been hidden? if ( ! display_header_text() ) : - ?> - .site-title, - .site-description { - position: absolute; - clip: rect(1px, 1px, 1px, 1px); - } - <?php - // If the user has set a custom color for the text use that. - else : - ?> - .site-title a, - .site-description { - color: #<?php echo esc_attr( $header_text_color ); ?>; - } - <?php endif; ?> - </style> - <?php -} + ?> + .site-title, + .site-description { + position: absolute; + clip: rect(1px, 1px, 1px, 1px); + } + <?php + // If the user has set a custom color for the text use that. + else : + ?> + .site-title a, + .site-description { + color: #<?php echo esc_attr( $header_text_color ); ?>; + } + <?php endif; ?> + </style> + <?php + } endif; diff --git a/inc/template-tags.php b/inc/template-tags.php index e4b9cf02..3260c44e 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -8,68 +8,85 @@ */ if ( ! function_exists( '_s_posted_on' ) ) : -/** - * Prints HTML with meta information for the current post-date/time and author. - */ -function _s_posted_on() { - $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; - if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { - $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; + /** + * Prints HTML with meta information for the current post-date/time and author. + */ + function _s_posted_on() { + $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; + } + + $time_string = sprintf( $time_string, + esc_attr( get_the_date( 'c' ) ), + esc_html( get_the_date() ), + esc_attr( get_the_modified_date( 'c' ) ), + esc_html( get_the_modified_date() ) + ); + + $posted_on = sprintf( + /* translators: %s: post date. */ + esc_html_x( 'Posted on %s', 'post date', '_s' ), + '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' + ); + + $byline = sprintf( + /* translators: %s: post author. */ + esc_html_x( 'by %s', 'post author', '_s' ), + '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>' + ); + + echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK. + } - - $time_string = sprintf( $time_string, - esc_attr( get_the_date( 'c' ) ), - esc_html( get_the_date() ), - esc_attr( get_the_modified_date( 'c' ) ), - esc_html( get_the_modified_date() ) - ); - - $posted_on = sprintf( - /* translators: %s: post date. */ - esc_html_x( 'Posted on %s', 'post date', '_s' ), - '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' - ); - - $byline = sprintf( - /* translators: %s: post author. */ - esc_html_x( 'by %s', 'post author', '_s' ), - '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>' - ); - - echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK. - -} endif; if ( ! function_exists( '_s_entry_footer' ) ) : -/** - * Prints HTML with meta information for the categories, tags and comments. - */ -function _s_entry_footer() { - // Hide category and tag text for pages. - if ( 'post' === get_post_type() ) { - /* translators: used between list items, there is a space after the comma */ - $categories_list = get_the_category_list( esc_html__( ', ', '_s' ) ); - if ( $categories_list ) { - /* translators: 1: list of categories. */ - printf( '<span class="cat-links">' . esc_html__( 'Posted in %1$s', '_s' ) . '</span>', $categories_list ); // WPCS: XSS OK. + /** + * Prints HTML with meta information for the categories, tags and comments. + */ + function _s_entry_footer() { + // Hide category and tag text for pages. + if ( 'post' === get_post_type() ) { + /* translators: used between list items, there is a space after the comma */ + $categories_list = get_the_category_list( esc_html__( ', ', '_s' ) ); + if ( $categories_list ) { + /* translators: 1: list of categories. */ + printf( '<span class="cat-links">' . esc_html__( 'Posted in %1$s', '_s' ) . '</span>', $categories_list ); // WPCS: XSS OK. + } + + /* translators: used between list items, there is a space after the comma */ + $tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', '_s' ) ); + if ( $tags_list ) { + /* translators: 1: list of tags. */ + printf( '<span class="tags-links">' . esc_html__( 'Tagged %1$s', '_s' ) . '</span>', $tags_list ); // WPCS: XSS OK. + } } - /* translators: used between list items, there is a space after the comma */ - $tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', '_s' ) ); - if ( $tags_list ) { - /* translators: 1: list of tags. */ - printf( '<span class="tags-links">' . esc_html__( 'Tagged %1$s', '_s' ) . '</span>', $tags_list ); // WPCS: XSS OK. + if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { + echo '<span class="comments-link">'; + comments_popup_link( + sprintf( + wp_kses( + /* translators: %s: post title */ + __( 'Leave a Comment<span class="screen-reader-text"> on %s</span>', '_s' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ), + get_the_title() + ) + ); + echo '</span>'; } - } - if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { - echo '<span class="comments-link">'; - comments_popup_link( + edit_post_link( sprintf( wp_kses( - /* translators: %s: post title */ - __( 'Leave a Comment<span class="screen-reader-text"> on %s</span>', '_s' ), + /* translators: %s: Name of current post. Only visible to screen readers */ + __( 'Edit <span class="screen-reader-text">%s</span>', '_s' ), array( 'span' => array( 'class' => array(), @@ -77,26 +94,9 @@ function _s_entry_footer() { ) ), get_the_title() - ) - ); - echo '</span>'; - } - - edit_post_link( - sprintf( - wp_kses( - /* translators: %s: Name of current post. Only visible to screen readers */ - __( 'Edit <span class="screen-reader-text">%s</span>', '_s' ), - array( - 'span' => array( - 'class' => array(), - ), - ) ), - get_the_title() - ), - '<span class="edit-link">', - '</span>' - ); -} + '<span class="edit-link">', + '</span>' + ); + } endif;