Skip to content

Commit cfc2b5e

Browse files
committed
Improve coding standards
1 parent d574ad9 commit cfc2b5e

36 files changed

+223
-409
lines changed

.travis.yml

Lines changed: 0 additions & 98 deletions
This file was deleted.

archive.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @link https://codex.wordpress.org/Template_Hierarchy
66
*
77
* @package scaffold
8-
* @copyright Copyright (c) 2017, Danny Cooper
8+
* @copyright Copyright (c) 2019, Danny Cooper
99
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
1010
*/
1111

assets/css/editor-style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Scaffold TinyMCE CSS
33
*
44
* @package scaffold
5-
* @copyright Copyright (c) 2017, Danny Cooper
5+
* @copyright Copyright (c) 2019, Danny Cooper
66
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
77
*/
88

assets/css/woocommerce.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Scaffold WooCommerce CSS
33
*
44
* @package scaffold
5-
* @copyright Copyright (c) 2017, Danny Cooper
5+
* @copyright Copyright (c) 2019, Danny Cooper
66
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
77
*/
88

assets/js/customizer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
77
*
88
* @package scaffold
9-
* @copyright Copyright (c) 2017, Danny Cooper
9+
* @copyright Copyright (c) 2019, Danny Cooper
1010
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
1111
*/
1212

assets/js/navigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* navigation support for dropdown menus.
44
*
55
* @package scaffold
6-
* @copyright Copyright (c) 2017, Danny Cooper
6+
* @copyright Copyright (c) 2019, Danny Cooper
77
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
88
*/
99

comments.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @link https://codex.wordpress.org/Template_Hierarchy
99
*
1010
* @package scaffold
11-
* @copyright Copyright (c) 2017, Danny Cooper
11+
* @copyright Copyright (c) 2019, Danny Cooper
1212
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
1313
*/
1414

@@ -32,14 +32,16 @@
3232
printf( esc_html_x( 'One Reply to “%s”', 'comments title', 'scaffold' ), get_the_title() );
3333
} else {
3434
printf(
35-
/* translators: 1: number of comments, 2: post title */
36-
esc_html( _nx(
37-
'%1$s Reply to “%2$s”',
38-
'%1$s Replies to “%2$s”',
39-
$comments_number,
40-
'comments title',
41-
'scaffold'
42-
) ),
35+
esc_html(
36+
/* translators: 1: number of comments, 2: post title */
37+
_nx(
38+
'%1$s Reply to “%2$s”',
39+
'%1$s Replies to “%2$s”',
40+
$comments_number,
41+
'comments title',
42+
'scaffold'
43+
)
44+
),
4345
esc_html( number_format_i18n( $comments_number ) ),
4446
get_the_title()
4547
);
@@ -74,12 +76,12 @@
7476
<?php esc_html_e( 'Comments are closed.', 'scaffold' ); ?>
7577
</p>
7678

77-
<?php
79+
<?php
7880
endif;
7981

8082
endif; // Check for have_comments().
8183

8284
comment_form();
83-
?>
85+
?>
8486

8587
</div><!-- #comments -->

footer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
88
*
99
* @package scaffold
10-
* @copyright Copyright (c) 2017, Danny Cooper
10+
* @copyright Copyright (c) 2019, Danny Cooper
1111
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
1212
*/
1313

functions.php

Lines changed: 52 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
* @link https://developer.wordpress.org/themes/basics/theme-functions/
66
*
77
* @package scaffold
8-
* @copyright Copyright (c) 2017, Danny Cooper
8+
* @copyright Copyright (c) 2019, Danny Cooper
99
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
1010
*/
1111

12+
define( 'SCAFFOLD_VERSION', '1.2.3' );
13+
1214
if ( ! function_exists( 'scaffold_setup' ) ) :
1315
/**
1416
* Sets up theme defaults and registers support for various WordPress features.
@@ -38,27 +40,38 @@ function scaffold_setup() {
3840
add_theme_support( 'post-thumbnails' );
3941

4042
// This theme uses wp_nav_menu() in one location.
41-
register_nav_menus( array(
42-
'menu-1' => esc_html__( 'Primary Menu', 'scaffold' ),
43-
) );
43+
register_nav_menus(
44+
array(
45+
'menu-1' => esc_html__( 'Primary Menu', 'scaffold' ),
46+
)
47+
);
4448

4549
/*
4650
* Switch default core markup for search form, comment form, and comments
4751
* to output valid HTML5.
4852
*/
49-
add_theme_support( 'html5', array(
50-
'search-form',
51-
'comment-form',
52-
'comment-list',
53-
'gallery',
54-
'caption',
55-
) );
53+
add_theme_support(
54+
'html5',
55+
array(
56+
'search-form',
57+
'comment-form',
58+
'comment-list',
59+
'gallery',
60+
'caption',
61+
)
62+
);
5663

5764
// Set up the WordPress core custom background feature.
58-
add_theme_support( 'custom-background', apply_filters( 'scaffold_custom_background_args', array(
59-
'default-color' => 'ffffff',
60-
'default-image' => '',
61-
) ) );
65+
add_theme_support(
66+
'custom-background',
67+
apply_filters(
68+
'scaffold_custom_background_args',
69+
array(
70+
'default-color' => 'ffffff',
71+
'default-image' => '',
72+
)
73+
)
74+
);
6275

6376
// Add theme support for selective refresh for widgets.
6477
add_theme_support( 'customize-selective-refresh-widgets' );
@@ -70,13 +83,16 @@ function scaffold_setup() {
7083
add_editor_style( '/assets/css/editor-style.css' );
7184

7285
// Add support for custom logo.
73-
add_theme_support( 'custom-logo', array(
74-
'height' => 100,
75-
'width' => 400,
76-
'flex-height' => true,
77-
'flex-width' => true,
78-
'header-text' => array( 'site-title', 'site-description' ),
79-
) );
86+
add_theme_support(
87+
'custom-logo',
88+
array(
89+
'height' => 100,
90+
'width' => 400,
91+
'flex-height' => true,
92+
'flex-width' => true,
93+
'header-text' => array( 'site-title', 'site-description' ),
94+
)
95+
);
8096

8197
// Add support for WooCommerce.
8298
add_theme_support( 'woocommerce' );
@@ -106,32 +122,34 @@ function scaffold_content_width() {
106122
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
107123
*/
108124
function scaffold_widgets_init() {
109-
register_sidebar( array(
110-
'name' => esc_html__( 'Sidebar', 'scaffold' ),
111-
'id' => 'sidebar-1',
112-
'description' => esc_html__( 'Add widgets here.', 'scaffold' ),
113-
'before_widget' => '<section class="widget %2$s">',
114-
'after_widget' => '</section>',
115-
'before_title' => '<h3 class="widget-title">',
116-
'after_title' => '</h3>',
117-
) );
125+
register_sidebar(
126+
array(
127+
'name' => esc_html__( 'Sidebar', 'scaffold' ),
128+
'id' => 'sidebar-1',
129+
'description' => esc_html__( 'Add widgets here.', 'scaffold' ),
130+
'before_widget' => '<section class="widget %2$s">',
131+
'after_widget' => '</section>',
132+
'before_title' => '<h3 class="widget-title">',
133+
'after_title' => '</h3>',
134+
)
135+
);
118136
}
119137
add_action( 'widgets_init', 'scaffold_widgets_init' );
120138

121139
/**
122140
* Enqueue scripts and styles.
123141
*/
124142
function scaffold_scripts() {
125-
wp_enqueue_style( 'scaffold-style', get_stylesheet_uri() );
143+
wp_enqueue_style( 'scaffold-style', get_stylesheet_uri(), array(), SCAFFOLD_VERSION );
126144

127-
wp_enqueue_script( 'scaffold-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), '20151215', true );
145+
wp_enqueue_script( 'scaffold-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), SCAFFOLD_VERSION, true );
128146

129147
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
130148
wp_enqueue_script( 'comment-reply' );
131149
}
132150

133151
if ( class_exists( 'WooCommerce' ) ) {
134-
wp_enqueue_style( 'scaffold-woocommerce', get_template_directory_uri() . '/assets/css/woocommerce.css' );
152+
wp_enqueue_style( 'scaffold-woocommerce', get_template_directory_uri() . '/assets/css/woocommerce.css', 'scaffold-style', SCAFFOLD_VERSION );
135153
}
136154
}
137155
add_action( 'wp_enqueue_scripts', 'scaffold_scripts' );

header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
88
*
99
* @package scaffold
10-
* @copyright Copyright (c) 2017, Danny Cooper
10+
* @copyright Copyright (c) 2019, Danny Cooper
1111
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
1212
*/
1313

0 commit comments

Comments
 (0)