diff --git a/.travis.yml b/.travis.yml index 4840c9fed2..c0e47cee45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,11 +26,11 @@ matrix: dist: precise # aliased to a recent 5.6.x version - php: '5.6' - env: SNIFF=1 # aliased to a recent 7.0.x version - php: '7.0' # aliased to a recent 7.2.x version - php: '7.2' + env: SNIFF=1 # bleeding edge PHP - php: 'nightly' @@ -52,15 +52,18 @@ before_script: - export PHPCS_DIR=/tmp/phpcs - export WPCS_DIR=/tmp/wpcs - export PHPCOMPAT_DIR=/tmp/phpcompatibility + - export PHPCOMPATWP_DIR=/tmp/phpcompatibilitywp # Install CodeSniffer for WordPress Coding Standards checks. - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi # Install WordPress Coding Standards. - - if [[ "$SNIFF" == "1" ]]; then git clone -b 0.14.1 --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR; fi + - if [[ "$SNIFF" == "1" ]]; then git clone -b 1.0.0 --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR; fi # Install PHP Compatibility sniffs. - - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $PHPCOMPAT_DIR; fi + - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/PHPCompatibility/PHPCompatibility.git $PHPCOMPAT_DIR; fi + # Install WP PHP Compatibility ruleset. + - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/PHPCompatibility/PHPCompatibilityWP.git $PHPCOMPATWP_DIR; 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/bin/phpcs --config-set installed_paths $WPCS_DIR,$PHPCOMPAT_DIR; fi + - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs --config-set installed_paths $WPCS_DIR,$PHPCOMPAT_DIR,$PHPCOMPATWP_DIR; fi # After CodeSniffer install you should refresh your path. - if [[ "$SNIFF" == "1" ]]; then phpenv rehash; fi # Install JSCS: JavaScript Code Style checker. diff --git a/functions.php b/functions.php index b7134e760e..3402750dd9 100644 --- a/functions.php +++ b/functions.php @@ -7,6 +7,11 @@ * @package _s */ +if ( ! defined( '_S_VERSION' ) ) { + // Replace #.# with the version number of the theme on each release. + define( '_S_VERSION', '#.#' ); +} + if ( ! function_exists( '_s_setup' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. @@ -120,11 +125,11 @@ function _s_widgets_init() { * Enqueue scripts and styles. */ function _s_scripts() { - wp_enqueue_style( '_s-style', get_stylesheet_uri() ); + wp_enqueue_style( '_s-style', get_stylesheet_uri(), array(), _S_VERSION ); - wp_enqueue_script( '_s-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true ); + wp_enqueue_script( '_s-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true ); - wp_enqueue_script( '_s-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true ); + wp_enqueue_script( '_s-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), _S_VERSION, true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); diff --git a/inc/custom-header.php b/inc/custom-header.php index a4c2a6cc42..243a1eb0a8 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -4,7 +4,7 @@ * * You can add an optional custom header image to header.php like so ... * - + * * * @link https://developer.wordpress.org/themes/functionality/custom-headers/ * @@ -57,9 +57,9 @@ function _s_header_style() { position: absolute; clip: rect(1px, 1px, 1px, 1px); } - .site-title a, .site-description { diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 6d6000ed02..97e14cb4e2 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -29,7 +29,7 @@ function _s_woocommerce_setup() { * @return void */ function _s_woocommerce_scripts() { - wp_enqueue_style( '_s-woocommerce-style', get_template_directory_uri() . '/woocommerce.css' ); + wp_enqueue_style( '_s-woocommerce-style', get_template_directory_uri() . '/woocommerce.css', array(), _S_VERSION ); $font_path = WC()->plugin_url() . '/assets/fonts/'; $inline_font = '@font-face { @@ -103,8 +103,8 @@ function _s_woocommerce_loop_columns() { /** * Related Products Args. * - * @param array $args related products args. - * @return array $args related products args. + * @param array $args Related products args. + * @return array $args Related products args. */ function _s_woocommerce_related_products_args( $args ) { $defaults = array( @@ -175,7 +175,7 @@ function _s_woocommerce_wrapper_before() { * @return void */ function _s_woocommerce_wrapper_after() { - ?> + ?> + * */ if ( ! function_exists( '_s_woocommerce_cart_link_fragment' ) ) { diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 578ce0255a..f74b0bfcb2 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -97,36 +97,7 @@ ############################################################################# --> - - - - - - - - - - - - - - - - - - - - - - - - - + +