Skip to content
This repository was archived by the owner on Sep 14, 2021. It is now read-only.

Commit 3c1f05b

Browse files
committed
Fix failing tests
1 parent 59ab992 commit 3c1f05b

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

.jshintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
"Backbone": false,
2222
"jQuery": false,
2323
"JSON": false,
24-
"wp": false,
24+
"wp": false
2525
}
2626
}

class-kirki-controls-bootstrap.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
return;
1515
}
1616

17+
/**
18+
* Takes care of bootstrapping Kirki Controls.
19+
*/
1720
class Kirki_Controls_Bootstrap {
1821

1922
/**
@@ -88,7 +91,6 @@ public function register_control_types() {
8891
*
8992
* @access public
9093
* @since 3.0.10
91-
* @param array $control_types Any pre-existing control-types.
9294
* @return array
9395
*/
9496
public function get_control_types() {
@@ -142,7 +144,7 @@ protected function autoload( $class_name ) {
142144
if ( 0 === stripos( $class_name, 'Kirki_Control_' ) || 0 === stripos( $class_name, 'Kirki_Settings_' ) ) {
143145

144146
// Build the file-path.
145-
$path = wp_normalize_path( dirname( __FILE__ ) . '/classes/' . 'class-' . strtolower( str_replace( '_', '-', $class_name ) ) . '.php' );
147+
$path = wp_normalize_path( dirname( __FILE__ ) . '/classes/class-' . strtolower( str_replace( '_', '-', $class_name ) ) . '.php' );
146148
if ( file_exists( $path ) ) {
147149
include_once $path;
148150
}
@@ -180,7 +182,7 @@ public static function get_url( $file ) {
180182
self::$url = str_replace( get_stylesheet_directory(), get_stylesheet_directory_uri(), KIRKI_CONTROLS_PATH );
181183
} elseif ( false !== strpos( KIRKI_CONTROLS_PATH, get_template_directory() ) ) {
182184
self::$url = str_replace( get_template_directory(), get_template_directory_uri(), KIRKI_CONTROLS_PATH );
183-
} elseif ( false !== strpos( KIRKI_CONTROLS_PATH, WP_PLUGIN_DIR ) ) {
185+
} elseif ( false !== strpos( KIRKI_CONTROLS_PATH, WP_PLUGIN_DIR ) ) {
184186
self::$url = str_replace( WP_PLUGIN_DIR, plugins_url(), KIRKI_CONTROLS_PATH );
185187
}
186188
}

phpcs.ruleset.xml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="WordPress Coding Standards">
3+
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
4+
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/WordPress-Core/ruleset.xml -->
5+
6+
<!-- Set a description for this ruleset. -->
7+
<description>A custom set of code standard rules to check for WordPress themes and plugins.</description>
8+
9+
<!-- Include the WordPress ruleset, with exclusions. -->
10+
<rule ref="WordPress">
11+
</rule>
12+
13+
<!-- Include sniffs for PHP cross-version compatibility. -->
14+
<rule ref="PHPCompatibility"/>
15+
</ruleset>

0 commit comments

Comments
 (0)