From 51c5f930191c7ec110527f7118909b9c7c81478d Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 18 Nov 2018 21:05:13 +0100 Subject: [PATCH 01/35] Fix space usage, indentation --- single.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/single.php b/single.php index ca59a54..ceff7fe 100644 --- a/single.php +++ b/single.php @@ -10,7 +10,7 @@ if ( ! defined( 'ABSPATH' ) ) { } get_header(); -$container = get_theme_mod( 'understrap_container_type' ); +$container = get_theme_mod( 'understrap_container_type' ); ?>
@@ -28,7 +28,7 @@ $container = get_theme_mod( 'understrap_container_type' ); - + - - + + -
+ - + - + From d979bf8a5a4f9e1206cc4c5ef7203933ac6e0327 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 18 Nov 2018 21:25:27 +0100 Subject: [PATCH 02/35] Update comments.php --- comments.php | 98 ++++++++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 45 deletions(-) diff --git a/comments.php b/comments.php index f8500d7..ee6e177 100644 --- a/comments.php +++ b/comments.php @@ -29,46 +29,49 @@ if ( post_password_required() ) {

- + ' . get_the_title() . '' - ); - } else { - printf( // WPCS: XSS OK. - /* translators: 1: number of comments, 2: post title */ - esc_html( _nx( - '%1$s thought on “%2$s”', - '%1$s thoughts on “%2$s”', - $comments_number, - 'comments title', - 'understrap' - ) ), - number_format_i18n( $comments_number ), - '' . get_the_title() . '' - ); - } + $comments_number = get_comments_number(); + if ( 1 === (int) $comments_number ) { + printf( + /* translators: %s: post title */ + esc_html_x( 'One thought on “%s”', 'comments title', 'understrap' ), + '' . get_the_title() . '' + ); + } else { + printf( // WPCS: XSS OK. + /* translators: 1: number of comments, 2: post title */ + esc_html( _nx( + '%1$s thought on “%2$s”', + '%1$s thoughts on “%2$s”', + $comments_number, + 'comments title', + 'understrap' + ) ), + number_format_i18n( $comments_number ), + '' . get_the_title() . '' + ); + } ?>

1 && get_option( 'page_comments' ) ) : // are there comments to navigate through. ?> - + @@ -78,31 +81,36 @@ if ( post_password_required() ) {
    'ol', - 'short_ping' => true, - ) ); + wp_list_comments( + array( + 'style' => 'ol', + 'short_ping' => true, + ) + ); ?>
1 && get_option( 'page_comments' ) ) : // are there comments to navigate through. ?> - + - + From 23f7c2ab4d7ba0d20095aa04588624742c8d3061 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 18 Nov 2018 21:45:52 +0100 Subject: [PATCH 03/35] Fix indentation --- searchform.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/searchform.php b/searchform.php index 657e612..f1c76e0 100644 --- a/searchform.php +++ b/searchform.php @@ -1,6 +1,6 @@ - + From 7bfca59655aee1472bfa604a108f900d1b070d0b Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 18 Nov 2018 21:49:45 +0100 Subject: [PATCH 04/35] Fix indentation & space usage --- search.php | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/search.php b/search.php index 09fe863..f1699f7 100644 --- a/search.php +++ b/search.php @@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) { get_header(); -$container = get_theme_mod( 'understrap_container_type' ); +$container = get_theme_mod( 'understrap_container_type' ); ?> @@ -29,11 +29,16 @@ $container = get_theme_mod( 'understrap_container_type' ); @@ -62,13 +67,13 @@ $container = get_theme_mod( 'understrap_container_type' ); - - + + - + - + - + From c71ba33ea70ed301a437a4fcb705cdb72c01a731 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 18 Nov 2018 21:52:47 +0100 Subject: [PATCH 05/35] Fix indentation & space usage --- page.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/page.php b/page.php index b7f0486..cf99c6b 100644 --- a/page.php +++ b/page.php @@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) { get_header(); -$container = get_theme_mod( 'understrap_container_type' ); +$container = get_theme_mod( 'understrap_container_type' ); ?> @@ -46,13 +46,13 @@ $container = get_theme_mod( 'understrap_container_type' ); - - + + - + - + - + From 5ff95a5989e563c8a48f71381579710cb6fcd009 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 18 Nov 2018 21:59:03 +0100 Subject: [PATCH 06/35] Fix indentation & space usage --- index.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/index.php b/index.php index fddf5dd..c7acb4c 100644 --- a/index.php +++ b/index.php @@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) { get_header(); -$container = get_theme_mod( 'understrap_container_type' ); +$container = get_theme_mod( 'understrap_container_type' ); ?> @@ -64,14 +64,13 @@ $container = get_theme_mod( 'understrap_container_type' ); - - - + + - + - + - + From 56035343db6bd66a4578a4b8ecac3dc86695f818 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 18 Nov 2018 22:01:04 +0100 Subject: [PATCH 07/35] Add missing space --- comments.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comments.php b/comments.php index ee6e177..b8a1c00 100644 --- a/comments.php +++ b/comments.php @@ -64,7 +64,7 @@ if ( post_password_required() ) { From c038da308a0b3a180c9b609b1238ab63449a2c43 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 18 Nov 2018 23:45:32 +0100 Subject: [PATCH 08/35] Fix space usage, indentation, readability --- author.php | 67 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/author.php b/author.php index 76ab557..080d972 100644 --- a/author.php +++ b/author.php @@ -12,10 +12,9 @@ if ( ! defined( 'ABSPATH' ) ) { } get_header(); -$container = get_theme_mod( 'understrap_container_type' ); +$container = get_theme_mod( 'understrap_container_type' ); ?> -
@@ -30,32 +29,36 @@ $container = get_theme_mod( 'understrap_container_type' ); @@ -65,11 +68,17 @@ $container = get_theme_mod( 'understrap_container_type' );
  • - - , - + %3$s', + esc_url( apply_filters( 'the_permalink', get_permalink( $post ), $post ) ), + esc_attr( __( 'Permanent Link:', 'understrap' ) ), + the_title( '', '', false ) + ); + ?> + + +
  • @@ -88,13 +97,13 @@ $container = get_theme_mod( 'understrap_container_type' ); - - + + -
    +
    - + - + From 63870cc4870fbe3fde477b7d47e2b2a32e1791b9 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 18 Nov 2018 23:47:21 +0100 Subject: [PATCH 09/35] Fix indentation & space usage --- archive.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/archive.php b/archive.php index cd7854e..49443f7 100644 --- a/archive.php +++ b/archive.php @@ -12,10 +12,8 @@ if ( ! defined( 'ABSPATH' ) ) { } get_header(); -?> -
    @@ -64,13 +62,13 @@ $container = get_theme_mod( 'understrap_container_type' ); - - + + -
    + - + - + From 623d97042199e21fde4c937ceeeb04fdbe82f8e8 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 18 Nov 2018 23:55:54 +0100 Subject: [PATCH 10/35] Fix indentation & space usage --- 404.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/404.php b/404.php index 6760db7..53ce3ad 100644 --- a/404.php +++ b/404.php @@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) { get_header(); -$container = get_theme_mod( 'understrap_container_type' ); +$container = get_theme_mod( 'understrap_container_type' ); ?>
    @@ -28,15 +28,13 @@ $container = get_theme_mod( 'understrap_container_type' );
    -

    +

    @@ -50,13 +48,15 @@ $container = get_theme_mod( 'understrap_container_type' ); @@ -83,8 +83,8 @@ $container = get_theme_mod( 'understrap_container_type' );
    -
    + - + From 05bc567e5db79064493c4bfe4893c1a85580f656 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 18 Nov 2018 23:57:22 +0100 Subject: [PATCH 11/35] Update sidebar-statichero.php --- sidebar-templates/sidebar-statichero.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sidebar-templates/sidebar-statichero.php b/sidebar-templates/sidebar-statichero.php index 2b6c53d..b6edbc2 100644 --- a/sidebar-templates/sidebar-statichero.php +++ b/sidebar-templates/sidebar-statichero.php @@ -5,11 +5,11 @@ * @package understrap */ -$container = get_theme_mod( 'understrap_container_type' ); if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } +$container = get_theme_mod( 'understrap_container_type' ); ?> From cfa59e691c5c48cc66449434f684417197a0672b Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 18 Nov 2018 23:59:06 +0100 Subject: [PATCH 12/35] Fix indentation --- sidebar-templates/sidebar-right.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sidebar-templates/sidebar-right.php b/sidebar-templates/sidebar-right.php index 83013fe..833c997 100644 --- a/sidebar-templates/sidebar-right.php +++ b/sidebar-templates/sidebar-right.php @@ -18,10 +18,10 @@ $sidebar_pos = get_theme_mod( 'understrap_sidebar_position' ); ?> - From 7835682f3603afc6a9f1a87f4601330f3bd52edc Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:10:53 +0100 Subject: [PATCH 17/35] Update empty.php --- page-templates/empty.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/page-templates/empty.php b/page-templates/empty.php index 2c11ff1..9a5a66b 100644 --- a/page-templates/empty.php +++ b/page-templates/empty.php @@ -14,7 +14,8 @@ if ( ! defined( 'ABSPATH' ) ) { get_header(); -while ( have_posts() ) : the_post(); +while ( have_posts() ) : + the_post(); get_template_part( 'loop-templates/content', 'empty' ); endwhile; From ba909450b6c1048fb454b9a02e68c0a55461c062 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:12:12 +0100 Subject: [PATCH 18/35] Update fullwidthpage.php --- page-templates/fullwidthpage.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/page-templates/fullwidthpage.php b/page-templates/fullwidthpage.php index a028f6a..cc5803f 100644 --- a/page-templates/fullwidthpage.php +++ b/page-templates/fullwidthpage.php @@ -32,9 +32,7 @@ $container = get_theme_mod( 'understrap_container_type' ); @@ -46,8 +44,8 @@ $container = get_theme_mod( 'understrap_container_type' ); - + - + From 35096acab3f034f56fcaadf16c46485dac1fcfb6 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:18:19 +0100 Subject: [PATCH 19/35] Update content.php --- loop-templates/content.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/loop-templates/content.php b/loop-templates/content.php index 3c0cb80..3f98975 100644 --- a/loop-templates/content.php +++ b/loop-templates/content.php @@ -14,8 +14,12 @@ if ( ! defined( 'ABSPATH' ) ) {
    - ', esc_url( get_permalink() ) ), - '' ); ?> + ', esc_url( get_permalink() ) ), + '' + ); + ?> @@ -31,15 +35,15 @@ if ( ! defined( 'ABSPATH' ) ) {
    - + '', - ) ); + wp_link_pages( + array( + 'before' => '', + ) + ); ?>
    From 5831ba385baba4f1721dd82a1ca7192cf6bf9718 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:18:55 +0100 Subject: [PATCH 20/35] Update content-single.php --- loop-templates/content-single.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/loop-templates/content-single.php b/loop-templates/content-single.php index 5f82da6..7c2ad9e 100644 --- a/loop-templates/content-single.php +++ b/loop-templates/content-single.php @@ -31,10 +31,12 @@ if ( ! defined( 'ABSPATH' ) ) { '', - ) ); + wp_link_pages( + array( + 'before' => '', + ) + ); ?> From d94e811686a9888ff00cb08fd9a94a8152e2ba47 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:19:54 +0100 Subject: [PATCH 21/35] Update content-search.php --- loop-templates/content-search.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/loop-templates/content-search.php b/loop-templates/content-search.php index 501cd92..cfb8c48 100644 --- a/loop-templates/content-search.php +++ b/loop-templates/content-search.php @@ -14,8 +14,12 @@ if ( ! defined( 'ABSPATH' ) ) {
    - ', esc_url( get_permalink() ) ), - '' ); ?> + ', esc_url( get_permalink() ) ), + '' + ); + ?> From 76a5c0fd3632afe1f144833dadd94f325e3a44f6 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:20:20 +0100 Subject: [PATCH 22/35] Update content-page.php --- loop-templates/content-page.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/loop-templates/content-page.php b/loop-templates/content-page.php index bb1fb2e..a2febee 100644 --- a/loop-templates/content-page.php +++ b/loop-templates/content-page.php @@ -25,10 +25,12 @@ if ( ! defined( 'ABSPATH' ) ) { '', - ) ); + wp_link_pages( + array( + 'before' => '', + ) + ); ?> From eff59106403a173e9d4badb5409716ff312a3796 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:24:26 +0100 Subject: [PATCH 23/35] Fix space usage --- inc/wpcom.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/wpcom.php b/inc/wpcom.php index 3de8a79..772bb6d 100644 --- a/inc/wpcom.php +++ b/inc/wpcom.php @@ -18,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) { */ add_action( 'after_setup_theme', 'understrap_wpcom_setup' ); -if ( ! function_exists ( 'understrap_wpcom_setup' ) ) { +if ( ! function_exists( 'understrap_wpcom_setup' ) ) { function understrap_wpcom_setup() { global $themecolors; @@ -44,7 +44,7 @@ if ( ! function_exists ( 'understrap_wpcom_setup' ) ) { */ add_action( 'wp_enqueue_scripts', 'understrap_wpcom_styles' ); -if ( ! function_exists ( 'understrap_wpcom_styles' ) ) { +if ( ! function_exists( 'understrap_wpcom_styles' ) ) { function understrap_wpcom_styles() { wp_enqueue_style( 'understrap-wpcom', get_template_directory_uri() . '/inc/style-wpcom.css', array(), '20160411' ); } From 9c8be5118d27ac10a74a7217bf0bb073eda6d570 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:26:03 +0100 Subject: [PATCH 24/35] Fix indentation & space usage --- inc/woocommerce.php | 54 ++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 3cd8e9b..29d3de0 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -17,7 +17,7 @@ if ( ! function_exists( 'understrap_woocommerce_support' ) ) { function understrap_woocommerce_support() { add_theme_support( 'woocommerce' ); - // Add New Woocommerce 3.0.0 Product Gallery support + // Add New Woocommerce 3.0.0 Product Gallery support. add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-slider' ); @@ -30,31 +30,31 @@ if ( ! function_exists( 'understrap_woocommerce_support' ) ) { /** * First unhook the WooCommerce wrappers */ -remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); -remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); +remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); +remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); /** * Then hook in your own functions to display the wrappers your theme requires */ -add_action('woocommerce_before_main_content', 'understrap_woocommerce_wrapper_start', 10); -add_action('woocommerce_after_main_content', 'understrap_woocommerce_wrapper_end', 10); +add_action( 'woocommerce_before_main_content', 'understrap_woocommerce_wrapper_start', 10 ); +add_action( 'woocommerce_after_main_content', 'understrap_woocommerce_wrapper_end', 10 ); if ( ! function_exists( 'understrap_woocommerce_wrapper_start' ) ) { function understrap_woocommerce_wrapper_start() { - $container = get_theme_mod( 'understrap_container_type' ); + $container = get_theme_mod( 'understrap_container_type' ); echo '
    '; - echo '
    '; + echo '
    '; echo '
    '; get_template_part( 'global-templates/left-sidebar-check' ); echo '
    '; } } if ( ! function_exists( 'understrap_woocommerce_wrapper_end' ) ) { -function understrap_woocommerce_wrapper_end() { - echo '
    '; - get_template_part( 'global-templates/right-sidebar-check' ); - echo '
    '; - echo '
    '; - echo '
    '; + function understrap_woocommerce_wrapper_end() { + echo ''; + get_template_part( 'global-templates/right-sidebar-check' ); + echo '
    '; + echo ''; + echo ''; } } @@ -69,12 +69,12 @@ function understrap_woocommerce_wrapper_end() { * * @return mixed */ -if ( ! function_exists ( 'understrap_wc_form_field_args' ) ) { +if ( ! function_exists( 'understrap_wc_form_field_args' ) ) { function understrap_wc_form_field_args( $args, $key, $value = null ) { // Start field type switch case. switch ( $args['type'] ) { /* Targets all select input type elements, except the country and state select input types */ - case 'select' : + case 'select': // Add a class to the field's html element wrapper - woocommerce // input types (fields) are often wrapped within a

    tag. $args['class'][] = 'form-group'; @@ -90,13 +90,13 @@ if ( ! function_exists ( 'understrap_wc_form_field_args' ) ) { break; // By default WooCommerce will populate a select with the country names - $args // defined for this specific input type targets only the country select element. - case 'country' : + case 'country': $args['class'][] = 'form-group single-country'; $args['label_class'] = array( 'control-label' ); break; // By default WooCommerce will populate a select with state names - $args defined // for this specific input type targets only the country select element. - case 'state' : + case 'state': // Add class to the field's html element wrapper. $args['class'][] = 'form-group'; // add class to the form input itself. @@ -108,28 +108,28 @@ if ( ! function_exists ( 'understrap_wc_form_field_args' ) ) { 'aria-hidden' => 'true', ); break; - case 'password' : - case 'text' : - case 'email' : - case 'tel' : - case 'number' : + case 'password': + case 'text': + case 'email': + case 'tel': + case 'number': $args['class'][] = 'form-group'; $args['input_class'] = array( 'form-control', 'input-lg' ); $args['label_class'] = array( 'control-label' ); break; - case 'textarea' : + case 'textarea': $args['input_class'] = array( 'form-control', 'input-lg' ); $args['label_class'] = array( 'control-label' ); break; - case 'checkbox' : + case 'checkbox': $args['label_class'] = array( 'custom-control custom-checkbox' ); $args['input_class'] = array( 'custom-control-input', 'input-lg' ); break; - case 'radio' : + case 'radio': $args['label_class'] = array( 'custom-control custom-radio' ); $args['input_class'] = array( 'custom-control-input', 'input-lg' ); break; - default : + default: $args['class'][] = 'form-group'; $args['input_class'] = array( 'form-control', 'input-lg' ); $args['label_class'] = array( 'control-label' ); @@ -137,4 +137,4 @@ if ( ! function_exists ( 'understrap_wc_form_field_args' ) ) { } // end switch ($args). return $args; } -} \ No newline at end of file +} From 024ddea2ab81b0d401a7b334e68f7da8c9c8ad87 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:27:49 +0100 Subject: [PATCH 25/35] Fix space usage --- inc/theme-settings.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/inc/theme-settings.php b/inc/theme-settings.php index 9bee616..0d2447d 100755 --- a/inc/theme-settings.php +++ b/inc/theme-settings.php @@ -3,14 +3,13 @@ * Check and setup theme's default settings * * @package understrap - * */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } -if ( ! function_exists ( 'understrap_setup_theme_default_settings' ) ) { +if ( ! function_exists( 'understrap_setup_theme_default_settings' ) ) { function understrap_setup_theme_default_settings() { // check if settings are set, if not set defaults. @@ -33,4 +32,4 @@ if ( ! function_exists ( 'understrap_setup_theme_default_settings' ) ) { set_theme_mod( 'understrap_container_type', 'container' ); } } -} \ No newline at end of file +} From ee459e936baf8936dd0a54fbdb7e7df9243ca48a Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:37:12 +0100 Subject: [PATCH 26/35] Fix indentation & space usage --- inc/pagination.php | 63 ++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/inc/pagination.php b/inc/pagination.php index 9a6ff79..2e9dfa5 100644 --- a/inc/pagination.php +++ b/inc/pagination.php @@ -9,48 +9,51 @@ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } -if ( ! function_exists ( 'understrap_pagination' ) ) { +if ( ! function_exists( 'understrap_pagination' ) ) { function understrap_pagination( $args = array(), $class = 'pagination' ) { - if ($GLOBALS['wp_query']->max_num_pages <= 1) return; + if ( $GLOBALS['wp_query']->max_num_pages <= 1 ) { + return; + } - $args = wp_parse_args( $args, array( - 'mid_size' => 2, - 'prev_next' => true, - 'prev_text' => __('«', 'understrap'), - 'next_text' => __('»', 'understrap'), - 'screen_reader_text' => __('Posts navigation', 'understrap'), - 'type' => 'array', - 'current' => max( 1, get_query_var('paged') ), - ) ); + $args = wp_parse_args( + $args, + array( + 'mid_size' => 2, + 'prev_next' => true, + 'prev_text' => __( '«', 'understrap' ), + 'next_text' => __( '»', 'understrap' ), + 'screen_reader_text' => __( 'Posts navigation', 'understrap' ), + 'type' => 'array', + 'current' => max( 1, get_query_var( 'paged' ) ), + ) + ); - $links = paginate_links($args); + $links = paginate_links( $args ); - ?> + ?> - - - From b1f541fcfcbe1de38e6be829c9e0b48be9702ba5 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:37:53 +0100 Subject: [PATCH 27/35] Fix indentation & space usage --- inc/jetpack.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/inc/jetpack.php b/inc/jetpack.php index 1c2579c..73c8e04 100644 --- a/inc/jetpack.php +++ b/inc/jetpack.php @@ -20,14 +20,17 @@ if ( ! defined( 'ABSPATH' ) ) { add_action( 'after_setup_theme', 'understrap_components_jetpack_setup' ); -if ( ! function_exists ( 'understrap_components_jetpack_setup' ) ) { +if ( ! function_exists( 'understrap_components_jetpack_setup' ) ) { function understrap_components_jetpack_setup() { // Add theme support for Infinite Scroll. - add_theme_support( 'infinite-scroll', array( - 'container' => 'main', - 'render' => 'understrap_components_infinite_scroll_render', - 'footer' => 'page', - ) ); + add_theme_support( + 'infinite-scroll', + array( + 'container' => 'main', + 'render' => 'understrap_components_infinite_scroll_render', + 'footer' => 'page', + ) + ); // Add theme support for Responsive Videos. add_theme_support( 'jetpack-responsive-videos' ); @@ -43,7 +46,7 @@ if ( ! function_exists ( 'understrap_components_jetpack_setup' ) ) { * Custom render function for Infinite Scroll. */ -if ( ! function_exists ( 'understrap_components_infinite_scroll_render' ) ) { +if ( ! function_exists( 'understrap_components_infinite_scroll_render' ) ) { function understrap_components_infinite_scroll_render() { while ( have_posts() ) { the_post(); @@ -56,7 +59,7 @@ if ( ! function_exists ( 'understrap_components_infinite_scroll_render' ) ) { } } -if ( ! function_exists ( 'understrap_components_social_menu' ) ) { +if ( ! function_exists( 'understrap_components_social_menu' ) ) { function understrap_components_social_menu() { if ( ! function_exists( 'jetpack_social_menu' ) ) { return; @@ -64,4 +67,4 @@ if ( ! function_exists ( 'understrap_components_social_menu' ) ) { jetpack_social_menu(); } } -} \ No newline at end of file +} From 8ecfeb4436db2a5cc2e7c591b1f59dcdab59eaf6 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:38:50 +0100 Subject: [PATCH 28/35] Fix indentation --- inc/hooks.php | 66 +++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/inc/hooks.php b/inc/hooks.php index 2de6401..e6752a5 100644 --- a/inc/hooks.php +++ b/inc/hooks.php @@ -10,40 +10,44 @@ if ( ! defined( 'ABSPATH' ) ) { } if ( ! function_exists( 'understrap_site_info' ) ) { - /** - * Add site info hook to WP hook library. - */ - function understrap_site_info() { - do_action( 'understrap_site_info' ); - } + /** + * Add site info hook to WP hook library. + */ + function understrap_site_info() { + do_action( 'understrap_site_info' ); + } } if ( ! function_exists( 'understrap_add_site_info' ) ) { - add_action( 'understrap_site_info', 'understrap_add_site_info' ); + add_action( 'understrap_site_info', 'understrap_add_site_info' ); - /** - * Add site info content. - */ - function understrap_add_site_info() { - $the_theme = wp_get_theme(); - - $site_info = sprintf( - '%2$s | %3$s(%4$s)', - esc_url( __( 'http://wordpress.org/', 'understrap' ) ), - sprintf( - /* translators:*/ - esc_html__( 'Proudly powered by %s', 'understrap' ), 'WordPress' - ), - sprintf( // WPCS: XSS ok. - /* translators:*/ - esc_html__( 'Theme: %1$s by %2$s.', 'understrap' ), $the_theme->get( 'Name' ), 'understrap.com' - ), - sprintf( // WPCS: XSS ok. - /* translators:*/ - esc_html__( 'Version: %1$s', 'understrap' ), $the_theme->get( 'Version' ) - ) - ); + /** + * Add site info content. + */ + function understrap_add_site_info() { + $the_theme = wp_get_theme(); - echo apply_filters( 'understrap_site_info_content', $site_info ); // WPCS: XSS ok. - } + $site_info = sprintf( + '%2$s | %3$s(%4$s)', + esc_url( __( 'http://wordpress.org/', 'understrap' ) ), + sprintf( + /* translators:*/ + esc_html__( 'Proudly powered by %s', 'understrap' ), + 'WordPress' + ), + sprintf( // WPCS: XSS ok. + /* translators:*/ + esc_html__( 'Theme: %1$s by %2$s.', 'understrap' ), + $the_theme->get( 'Name' ), + 'understrap.com' + ), + sprintf( // WPCS: XSS ok. + /* translators:*/ + esc_html__( 'Version: %1$s', 'understrap' ), + $the_theme->get( 'Version' ) + ) + ); + + echo apply_filters( 'understrap_site_info_content', $site_info ); // WPCS: XSS ok. + } } From cf15b3eb76ed1a6c34d07ba59ceb20f1df052381 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:40:25 +0100 Subject: [PATCH 29/35] Fix space usage --- inc/enqueue.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/inc/enqueue.php b/inc/enqueue.php index 9748b81..92c6798 100644 --- a/inc/enqueue.php +++ b/inc/enqueue.php @@ -15,15 +15,15 @@ if ( ! function_exists( 'understrap_scripts' ) ) { */ function understrap_scripts() { // Get the theme data. - $the_theme = wp_get_theme(); + $the_theme = wp_get_theme(); $theme_version = $the_theme->get( 'Version' ); - - $css_version = $theme_version . '.' . filemtime(get_template_directory() . '/css/theme.min.css'); + + $css_version = $theme_version . '.' . filemtime( get_template_directory() . '/css/theme.min.css' ); wp_enqueue_style( 'understrap-styles', get_stylesheet_directory_uri() . '/css/theme.min.css', array(), $css_version ); - wp_enqueue_script( 'jquery'); - - $js_version = $theme_version . '.' . filemtime(get_template_directory() . '/js/theme.min.js'); + wp_enqueue_script( 'jquery' ); + + $js_version = $theme_version . '.' . filemtime( get_template_directory() . '/js/theme.min.js' ); wp_enqueue_script( 'understrap-scripts', get_template_directory_uri() . '/js/theme.min.js', array(), $js_version, true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); @@ -31,4 +31,4 @@ if ( ! function_exists( 'understrap_scripts' ) ) { } } // endif function_exists( 'understrap_scripts' ). -add_action( 'wp_enqueue_scripts', 'understrap_scripts' ); \ No newline at end of file +add_action( 'wp_enqueue_scripts', 'understrap_scripts' ); From c8274df833ba0888127d4f14565486449a8d2302 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:41:38 +0100 Subject: [PATCH 30/35] Fix indentation & space usage --- inc/editor.php | 94 +++++++++++++++++++++++++------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/inc/editor.php b/inc/editor.php index 4b71ee9..826e21a 100644 --- a/inc/editor.php +++ b/inc/editor.php @@ -15,64 +15,64 @@ if ( ! defined( 'ABSPATH' ) ) { add_action( 'admin_init', 'understrap_wpdocs_theme_add_editor_styles' ); -if ( ! function_exists ( 'understrap_wpdocs_theme_add_editor_styles' ) ) { - function understrap_wpdocs_theme_add_editor_styles() { - add_editor_style( 'css/custom-editor-style.min.css' ); - } +if ( ! function_exists( 'understrap_wpdocs_theme_add_editor_styles' ) ) { + function understrap_wpdocs_theme_add_editor_styles() { + add_editor_style( 'css/custom-editor-style.min.css' ); + } } // Add TinyMCE style formats. add_filter( 'mce_buttons_2', 'understrap_tiny_mce_style_formats' ); -if ( ! function_exists ( 'understrap_tiny_mce_style_formats' ) ) { - function understrap_tiny_mce_style_formats( $styles ) { +if ( ! function_exists( 'understrap_tiny_mce_style_formats' ) ) { + function understrap_tiny_mce_style_formats( $styles ) { - array_unshift( $styles, 'styleselect' ); - return $styles; - } + array_unshift( $styles, 'styleselect' ); + return $styles; + } } add_filter( 'tiny_mce_before_init', 'understrap_tiny_mce_before_init' ); -if ( ! function_exists ( 'understrap_tiny_mce_before_init' ) ) { - function understrap_tiny_mce_before_init( $settings ) { +if ( ! function_exists( 'understrap_tiny_mce_before_init' ) ) { + function understrap_tiny_mce_before_init( $settings ) { - $style_formats = array( - array( - 'title' => 'Lead Paragraph', - 'selector' => 'p', - 'classes' => 'lead', - 'wrapper' => true - ), - array( - 'title' => 'Small', - 'inline' => 'small' - ), - array( - 'title' => 'Blockquote', - 'block' => 'blockquote', - 'classes' => 'blockquote', - 'wrapper' => true - ), - array( - 'title' => 'Blockquote Footer', - 'block' => 'footer', - 'classes' => 'blockquote-footer', - 'wrapper' => true - ), - array( - 'title' => 'Cite', - 'inline' => 'cite' - ) - ); - - if ( isset( $settings['style_formats'] ) ) { - $orig_style_formats = json_decode($settings['style_formats'],true); - $style_formats = array_merge($orig_style_formats,$style_formats); - } + $style_formats = array( + array( + 'title' => 'Lead Paragraph', + 'selector' => 'p', + 'classes' => 'lead', + 'wrapper' => true, + ), + array( + 'title' => 'Small', + 'inline' => 'small', + ), + array( + 'title' => 'Blockquote', + 'block' => 'blockquote', + 'classes' => 'blockquote', + 'wrapper' => true, + ), + array( + 'title' => 'Blockquote Footer', + 'block' => 'footer', + 'classes' => 'blockquote-footer', + 'wrapper' => true, + ), + array( + 'title' => 'Cite', + 'inline' => 'cite', + ), + ); - $settings['style_formats'] = json_encode( $style_formats ); - return $settings; - } + if ( isset( $settings['style_formats'] ) ) { + $orig_style_formats = json_decode( $settings['style_formats'], true ); + $style_formats = array_merge( $orig_style_formats, $style_formats ); + } + + $settings['style_formats'] = json_encode( $style_formats ); + return $settings; + } } From b653d6f2ce387042b483b1ee8911731c5b795ed8 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:43:14 +0100 Subject: [PATCH 31/35] Fix identation --- inc/customizer.php | 99 +++++++++++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 40 deletions(-) diff --git a/inc/customizer.php b/inc/customizer.php index 6729d77..c774f43 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -37,12 +37,15 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) { function understrap_theme_customize_register( $wp_customize ) { // Theme layout settings. - $wp_customize->add_section( 'understrap_theme_layout_options', array( - 'title' => __( 'Theme Layout Settings', 'understrap' ), - 'capability' => 'edit_theme_options', - 'description' => __( 'Container width and sidebar defaults', 'understrap' ), - 'priority' => 160, - ) ); + $wp_customize->add_section( + 'understrap_theme_layout_options', + array( + 'title' => __( 'Theme Layout Settings', 'understrap' ), + 'capability' => 'edit_theme_options', + 'description' => __( 'Container width and sidebar defaults', 'understrap' ), + 'priority' => 160, + ) + ); /** * Select sanitization function @@ -51,30 +54,34 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) { * @param WP_Customize_Setting $setting Setting instance. * @return string Sanitized slug if it is a valid choice; otherwise, the setting default. */ - function understrap_theme_slug_sanitize_select( $input, $setting ){ + function understrap_theme_slug_sanitize_select( $input, $setting ) { - // Ensure input is a slug (lowercase alphanumeric characters, dashes and underscores are allowed only). - $input = sanitize_key( $input ); + // Ensure input is a slug (lowercase alphanumeric characters, dashes and underscores are allowed only). + $input = sanitize_key( $input ); - // Get the list of possible select options. - $choices = $setting->manager->get_control( $setting->id )->choices; + // Get the list of possible select options. + $choices = $setting->manager->get_control( $setting->id )->choices; - // If the input is a valid key, return it; otherwise, return the default. - return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); + // If the input is a valid key, return it; otherwise, return the default. + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); - } + } - $wp_customize->add_setting( 'understrap_container_type', array( - 'default' => 'container', - 'type' => 'theme_mod', - 'sanitize_callback' => 'understrap_theme_slug_sanitize_select', - 'capability' => 'edit_theme_options', - ) ); + $wp_customize->add_setting( + 'understrap_container_type', + array( + 'default' => 'container', + 'type' => 'theme_mod', + 'sanitize_callback' => 'understrap_theme_slug_sanitize_select', + 'capability' => 'edit_theme_options', + ) + ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, - 'understrap_container_type', array( + 'understrap_container_type', + array( 'label' => __( 'Container Width', 'understrap' ), 'description' => __( 'Choose between Bootstrap\'s container and container-fluid', 'understrap' ), 'section' => 'understrap_theme_layout_options', @@ -86,35 +93,43 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) { ), 'priority' => '10', ) - ) ); + ) + ); - $wp_customize->add_setting( 'understrap_sidebar_position', array( - 'default' => 'right', - 'type' => 'theme_mod', - 'sanitize_callback' => 'sanitize_text_field', - 'capability' => 'edit_theme_options', - ) ); + $wp_customize->add_setting( + 'understrap_sidebar_position', + array( + 'default' => 'right', + 'type' => 'theme_mod', + 'sanitize_callback' => 'sanitize_text_field', + 'capability' => 'edit_theme_options', + ) + ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, - 'understrap_sidebar_position', array( - 'label' => __( 'Sidebar Positioning', 'understrap' ), - 'description' => __( 'Set sidebar\'s default position. Can either be: right, left, both or none. Note: this can be overridden on individual pages.', - 'understrap' ), - 'section' => 'understrap_theme_layout_options', - 'settings' => 'understrap_sidebar_position', - 'type' => 'select', + 'understrap_sidebar_position', + array( + 'label' => __( 'Sidebar Positioning', 'understrap' ), + 'description' => __( + 'Set sidebar\'s default position. Can either be: right, left, both or none. Note: this can be overridden on individual pages.', + 'understrap' + ), + 'section' => 'understrap_theme_layout_options', + 'settings' => 'understrap_sidebar_position', + 'type' => 'select', 'sanitize_callback' => 'understrap_theme_slug_sanitize_select', - 'choices' => array( + 'choices' => array( 'right' => __( 'Right sidebar', 'understrap' ), 'left' => __( 'Left sidebar', 'understrap' ), 'both' => __( 'Left & Right sidebars', 'understrap' ), 'none' => __( 'No sidebar', 'understrap' ), ), - 'priority' => '20', + 'priority' => '20', ) - ) ); + ) + ); } } // endif function_exists( 'understrap_theme_customize_register' ). add_action( 'customize_register', 'understrap_theme_customize_register' ); @@ -127,8 +142,12 @@ if ( ! function_exists( 'understrap_customize_preview_js' ) ) { * Setup JS integration for live previewing. */ function understrap_customize_preview_js() { - wp_enqueue_script( 'understrap_customizer', get_template_directory_uri() . '/js/customizer.js', - array( 'customize-preview' ), '20130508', true + wp_enqueue_script( + 'understrap_customizer', + get_template_directory_uri() . '/js/customizer.js', + array( 'customize-preview' ), + '20130508', + true ); } } From 7ee9cfd18edecaabccb40eb61ca893dd1b9243e9 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:44:58 +0100 Subject: [PATCH 32/35] Fix indentation & space usage --- inc/custom-header.php | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/inc/custom-header.php b/inc/custom-header.php index b66a416..b711882 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) { add_action( 'after_setup_theme', 'understrap_custom_header_setup' ); -if ( ! function_exists ( 'understrap_custom_header_setup' ) ) { +if ( ! function_exists( 'understrap_custom_header_setup' ) ) { function understrap_custom_header_setup() { /** @@ -22,28 +22,36 @@ if ( ! function_exists ( 'understrap_custom_header_setup' ) ) { * @param array $args { * An array of custom-header support arguments. * - * @type string $default-image Default image of the header. + * @type string $default-image Default image of the header. * @type string $default_text_color Default color of the header text. * @type int $width Width in pixels of the custom header image. Default 954. * @type int $height Height in pixels of the custom header image. Default 1300. * @type string $wp-head-callback Callback function used to styles the header image and text * displayed on the blog. - * @type string $flex-height Flex support for height of header. + * @type string $flex-height Flex support for height of header. * } */ - add_theme_support( 'custom-header', apply_filters( 'understrap_custom_header_args', array( - 'default-image' => get_parent_theme_file_uri( '/img/header.jpg' ), - 'width' => 2000, - 'height' => 1200, - 'flex-height' => true, - ) ) ); + add_theme_support( + 'custom-header', + apply_filters( + 'understrap_custom_header_args', + array( + 'default-image' => get_parent_theme_file_uri( '/img/header.jpg' ), + 'width' => 2000, + 'height' => 1200, + 'flex-height' => true, + ) + ) + ); - register_default_headers( array( - 'default-image' => array( - 'url' => '%s/img/header.jpg', - 'thumbnail_url' => '%s/img/header.jpg', - 'description' => __( 'Default Header Image', 'understrap' ), - ), - ) ); + register_default_headers( + array( + 'default-image' => array( + 'url' => '%s/img/header.jpg', + 'thumbnail_url' => '%s/img/header.jpg', + 'description' => __( 'Default Header Image', 'understrap' ), + ), + ) + ); } -} \ No newline at end of file +} From 97cde9c3c542e356a2cdeb54d9898090e223a59e Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:46:30 +0100 Subject: [PATCH 33/35] Fix indentation --- global-templates/right-sidebar-check.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global-templates/right-sidebar-check.php b/global-templates/right-sidebar-check.php index e32e375..826baab 100644 --- a/global-templates/right-sidebar-check.php +++ b/global-templates/right-sidebar-check.php @@ -16,6 +16,6 @@ if ( ! defined( 'ABSPATH' ) ) { - + From 47b5893376cd58b2db0c53bfe748866c18dfa8c6 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:47:07 +0100 Subject: [PATCH 34/35] Fix identation --- global-templates/left-sidebar-check.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/global-templates/left-sidebar-check.php b/global-templates/left-sidebar-check.php index cd36173..3ac77bf 100644 --- a/global-templates/left-sidebar-check.php +++ b/global-templates/left-sidebar-check.php @@ -8,14 +8,12 @@ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } -?> - - +
    From 59407d69eff107491d1d8c2bcae133aea8d970c4 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Mon, 19 Nov 2018 00:48:38 +0100 Subject: [PATCH 35/35] Remove superfluous space --- global-templates/hero.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global-templates/hero.php b/global-templates/hero.php index fb02503..18242b9 100644 --- a/global-templates/hero.php +++ b/global-templates/hero.php @@ -13,9 +13,9 @@ if ( ! defined( 'ABSPATH' ) ) {
    - + - +