Completed
Push — develop ( efa514...f6ac94 )
by Paul
02:12
created
src/Helpers/Theme.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,9 @@
 block discarded – undo
72 72
 	public function pageTitle()
73 73
 	{
74 74
 		foreach( ['is_404', 'is_archive', 'is_home', 'is_page', 'is_search'] as $bool ) {
75
-			if( !$bool() )continue;
75
+			if( !$bool() ) {
76
+				continue;
77
+			}
76 78
 			$method = sprintf( 'get%sTitle', ucfirst( str_replace( 'is_', '', $bool )));
77 79
 			return $this->$method();
78 80
 		}
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 {
9 9
 	public $postmeta;
10 10
 
11
-	public function __construct( PostMeta $postmeta )
11
+	public function __construct(PostMeta $postmeta)
12 12
 	{
13 13
 		$this->postmeta = $postmeta;
14 14
 	}
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @return string
20 20
 	 */
21
-	public function assetPath( $asset )
21
+	public function assetPath($asset)
22 22
 	{
23
-		return $this->paths( 'dir.stylesheet' ) . 'assets/' . $asset;
23
+		return $this->paths('dir.stylesheet') . 'assets/' . $asset;
24 24
 	}
25 25
 
26 26
 	/**
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @return string
30 30
 	 */
31
-	public function assetUri( $asset )
31
+	public function assetUri($asset)
32 32
 	{
33
-		return $this->paths( 'uri.stylesheet' ) . 'assets/' . $asset;
33
+		return $this->paths('uri.stylesheet') . 'assets/' . $asset;
34 34
 	}
35 35
 
36 36
 	/**
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 			is_single(),
45 45
 		];
46 46
 
47
-		$display = in_array( true, $conditions );
47
+		$display = in_array(true, $conditions);
48 48
 
49
-		return apply_filters( 'castor/display/sidebar', $display );
49
+		return apply_filters('castor/display/sidebar', $display);
50 50
 	}
51 51
 
52 52
 	/**
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 	 *
55 55
 	 * @return string
56 56
 	 */
57
-	public function imagePath( $asset )
57
+	public function imagePath($asset)
58 58
 	{
59
-		return $this->paths( 'dir.stylesheet' ) . 'assets/img/' . $asset;
59
+		return $this->paths('dir.stylesheet') . 'assets/img/' . $asset;
60 60
 	}
61 61
 
62 62
 	/**
@@ -64,16 +64,16 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @return string
66 66
 	 */
67
-	public function imageUri( $asset )
67
+	public function imageUri($asset)
68 68
 	{
69
-		return $this->paths( 'uri.stylesheet' ) . 'assets/img/' . $asset;
69
+		return $this->paths('uri.stylesheet') . 'assets/img/' . $asset;
70 70
 	}
71 71
 
72 72
 	public function pageTitle()
73 73
 	{
74
-		foreach( ['is_404', 'is_archive', 'is_home', 'is_page', 'is_search'] as $bool ) {
75
-			if( !$bool() )continue;
76
-			$method = sprintf( 'get%sTitle', ucfirst( str_replace( 'is_', '', $bool )));
74
+		foreach (['is_404', 'is_archive', 'is_home', 'is_page', 'is_search'] as $bool) {
75
+			if (!$bool())continue;
76
+			$method = sprintf('get%sTitle', ucfirst(str_replace('is_', '', $bool)));
77 77
 			return $this->$method();
78 78
 		}
79 79
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 *
86 86
 	 * @return array|string
87 87
 	 */
88
-	public function paths( $path = null )
88
+	public function paths($path = null)
89 89
 	{
90 90
 		$paths = [
91 91
 			'dir.stylesheet' => get_stylesheet_directory(),
@@ -95,18 +95,18 @@  discard block
 block discarded – undo
95 95
 			'uri.template'   => get_template_directory_uri(),
96 96
 		];
97 97
 
98
-		if( is_null( $path )) {
98
+		if (is_null($path)) {
99 99
 			return $paths;
100 100
 		}
101 101
 
102
-		return array_key_exists( $path, $paths )
103
-			? trailingslashit( $paths[$path] )
102
+		return array_key_exists($path, $paths)
103
+			? trailingslashit($paths[$path])
104 104
 			: '';
105 105
 	}
106 106
 
107 107
 	protected function get404Title()
108 108
 	{
109
-		return __( 'Not Found', 'castor' );
109
+		return __('Not Found', 'castor');
110 110
 	}
111 111
 
112 112
 	protected function getArchiveTitle()
@@ -116,20 +116,20 @@  discard block
 block discarded – undo
116 116
 
117 117
 	protected function getHomeTitle()
118 118
 	{
119
-		return ( $home = get_option( 'page_for_posts', true ))
120
-			? get_the_title( $home )
121
-			: __( 'Latest Posts', 'castor' );
119
+		return ($home = get_option('page_for_posts', true))
120
+			? get_the_title($home)
121
+			: __('Latest Posts', 'castor');
122 122
 	}
123 123
 
124 124
 	protected function getPageTitle()
125 125
 	{
126
-		return ($title = $this->postmeta->get( 'title' ))
126
+		return ($title = $this->postmeta->get('title'))
127 127
 			? $title
128 128
 			: get_the_title();
129 129
 	}
130 130
 
131 131
 	protected function getSearchTitle()
132 132
 	{
133
-		return sprintf( __( 'Search Results for %s', 'castor' ), get_search_query() );
133
+		return sprintf(__('Search Results for %s', 'castor'), get_search_query());
134 134
 	}
135 135
 }
Please login to merge, or discard this patch.
src/Helpers/PostMeta.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 
5 5
 class PostMeta
6 6
 {
7
-	public function get( $value, array $args = [] )
7
+	public function get($value, array $args = [])
8 8
 	{
9 9
 		$defaults = [
10 10
 			'ID'       => get_the_ID(),
@@ -13,15 +13,15 @@  discard block
 block discarded – undo
13 13
 			'prefix'   => 'pollux_',
14 14
 		];
15 15
 
16
-		$args = shortcode_atts( $defaults, $args );
16
+		$args = shortcode_atts($defaults, $args);
17 17
 
18
-		if( $value[0] == '_' && !empty( $args['prefix'] )) {
19
-			$args['prefix'] = sprintf( '_%s', rtrim( $args['prefix'], '_' ));
18
+		if ($value[0] == '_' && !empty($args['prefix'])) {
19
+			$args['prefix'] = sprintf('_%s', rtrim($args['prefix'], '_'));
20 20
 		}
21 21
 
22
-		$metaValue = get_post_meta( $args['ID'], $args['prefix'] . $value, $args['single'] );
22
+		$metaValue = get_post_meta($args['ID'], $args['prefix'] . $value, $args['single']);
23 23
 
24
-		return empty( $metaValue )
24
+		return empty($metaValue)
25 25
 			? $args['fallback']
26 26
 			: $metaValue;
27 27
 	}
Please login to merge, or discard this patch.
src/Facades/PostMeta.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@
 block discarded – undo
6 6
 
7 7
 class PostMeta extends Facade
8 8
 {
9
-    /**
10
-     * Get the fully qualified class name of the component.
11
-     *
12
-     * @return string
13
-     */
14
-    protected static function getFacadeAccessor()
15
-    {
16
-        return \GeminiLabs\Castor\Helpers\PostMeta::class;
17
-    }
9
+	/**
10
+	 * Get the fully qualified class name of the component.
11
+	 *
12
+	 * @return string
13
+	 */
14
+	protected static function getFacadeAccessor()
15
+	{
16
+		return \GeminiLabs\Castor\Helpers\PostMeta::class;
17
+	}
18 18
 }
Please login to merge, or discard this patch.
src/Facades/Media.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@
 block discarded – undo
6 6
 
7 7
 class Media extends Facade
8 8
 {
9
-    /**
10
-     * Get the fully qualified class name of the component.
11
-     *
12
-     * @return string
13
-     */
14
-    protected static function getFacadeAccessor()
15
-    {
16
-        return \GeminiLabs\Castor\Helpers\Media::class;
17
-    }
9
+	/**
10
+	 * Get the fully qualified class name of the component.
11
+	 *
12
+	 * @return string
13
+	 */
14
+	protected static function getFacadeAccessor()
15
+	{
16
+		return \GeminiLabs\Castor\Helpers\Media::class;
17
+	}
18 18
 }
Please login to merge, or discard this patch.
src/Helpers/Media.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,9 @@  discard block
 block discarded – undo
64 64
 	public function renderGalleryImage( WP_Post $attachment )
65 65
 	{
66 66
 		$image = $this->getImageSrc( $attachment->ID );
67
-		if( !$image )return;
67
+		if( !$image ) {
68
+			return;
69
+		}
68 70
 		return sprintf(
69 71
 			'<figure class="gallery-image" data-w="%s" data-h="%s" data-ps=\'%s\' itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">' .
70 72
 				'<a href="%s" itemprop="contentUrl"><img src="%s" data-src="%s" itemprop="thumbnail" alt="%s"/></a>' .
@@ -118,7 +120,9 @@  discard block
 block discarded – undo
118 120
 	{
119 121
 		$thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' );
120 122
 
121
-		if( !$thumbnail )return;
123
+		if( !$thumbnail ) {
124
+			return;
125
+		}
122 126
 
123 127
 		$medium = $this->normalizeImageSrc( wp_get_attachment_image_src( $id, 'medium' ), $thumbnail );
124 128
 		$large = $this->normalizeImageSrc( wp_get_attachment_image_src( $id, 'large' ), $medium );
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 	public $postmeta;
13 13
 	public $theme;
14 14
 
15
-	public function __construct( PostMeta $postmeta, Theme $theme )
15
+	public function __construct(PostMeta $postmeta, Theme $theme)
16 16
 	{
17 17
 		$this->postmeta = $postmeta;
18 18
 		$this->theme    = $theme;
@@ -21,50 +21,50 @@  discard block
 block discarded – undo
21 21
 	/**
22 22
 	 * @return string
23 23
 	 */
24
-	public function gallery( array $args = [] )
24
+	public function gallery(array $args = [])
25 25
 	{
26
-		$gallery = $this->getGallery( $args );
26
+		$gallery = $this->getGallery($args);
27 27
 
28
-		return $this->renderGallery( $gallery ) . $this->renderGalleryPagination( $gallery );
28
+		return $this->renderGallery($gallery) . $this->renderGalleryPagination($gallery);
29 29
 	}
30 30
 
31 31
 	/**
32 32
 	 * @return WP_Query
33 33
 	 */
34
-	public function getGallery( array $args )
34
+	public function getGallery(array $args)
35 35
 	{
36
-		$args = $this->normalizeArgs( $args );
36
+		$args = $this->normalizeArgs($args);
37 37
 
38 38
 		return new WP_Query([
39 39
 			'orderby'        => 'post__in',
40 40
 			'paged'          => $this->getPaged(),
41
-			'post__in'       => $this->getMediaIds( $args ),
41
+			'post__in'       => $this->getMediaIds($args),
42 42
 			'post_mime_type' => 'image',
43 43
 			'post_type'      => 'attachment',
44 44
 			'post_status'    => 'inherit',
45
-			'posts_per_page' => $this->getImagesPerPage( $args ),
45
+			'posts_per_page' => $this->getImagesPerPage($args),
46 46
 		]);
47 47
 	}
48 48
 
49 49
 	/**
50 50
 	 * @return string
51 51
 	 */
52
-	public function renderGallery( WP_Query $gallery )
52
+	public function renderGallery(WP_Query $gallery)
53 53
 	{
54
-		$images = array_reduce( $gallery->posts, function( $images, $attachment ) {
55
-			return $images . $this->renderGalleryImage( $attachment );
54
+		$images = array_reduce($gallery->posts, function($images, $attachment) {
55
+			return $images . $this->renderGalleryImage($attachment);
56 56
 		});
57 57
 
58
-		return sprintf( '<div class="gallery-images" itemscope itemtype="http://schema.org/ImageGallery">%s</div>', $images );
58
+		return sprintf('<div class="gallery-images" itemscope itemtype="http://schema.org/ImageGallery">%s</div>', $images);
59 59
 	}
60 60
 
61 61
 	/**
62 62
 	 * @return null|string
63 63
 	 */
64
-	public function renderGalleryImage( WP_Post $attachment )
64
+	public function renderGalleryImage(WP_Post $attachment)
65 65
 	{
66
-		$image = $this->getImageSrc( $attachment->ID );
67
-		if( !$image )return;
66
+		$image = $this->getImageSrc($attachment->ID);
67
+		if (!$image)return;
68 68
 		return sprintf(
69 69
 			'<figure class="gallery-image" data-w="%s" data-h="%s" data-ps=\'%s\' itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">' .
70 70
 				'<a href="%s" itemprop="contentUrl"><img src="%s" data-src="%s" itemprop="thumbnail" alt="%s"/></a>' .
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
 			'</figure>',
73 73
 			$image->thumbnail['width'],
74 74
 			$image->thumbnail['height'],
75
-			$this->getPhotoswipeData( $image ),
76
-			get_attachment_link( $attachment->ID ),
77
-			$this->theme->imageUri( 'blank.gif' ),
75
+			$this->getPhotoswipeData($image),
76
+			get_attachment_link($attachment->ID),
77
+			$this->theme->imageUri('blank.gif'),
78 78
 			$image->thumbnail['url'],
79 79
 			$image->alt,
80 80
 			$image->caption,
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
 	/**
86 86
 	 * @return string
87 87
 	 */
88
-	public function renderGalleryPagination( WP_Query $query )
88
+	public function renderGalleryPagination(WP_Query $query)
89 89
 	{
90 90
 		return paginate_links([
91
-			'before_page_number' => '<span class="screen-reader-text">' . __( 'Page', 'castor' ) . ' </span>',
91
+			'before_page_number' => '<span class="screen-reader-text">' . __('Page', 'castor') . ' </span>',
92 92
 			'current'            => $query->query['paged'],
93 93
 			'mid_size'           => 1,
94
-			'next_text'          => __( 'Next', 'castor' ),
95
-			'prev_text'          => __( 'Previous', 'castor' ),
94
+			'next_text'          => __('Next', 'castor'),
95
+			'prev_text'          => __('Previous', 'castor'),
96 96
 			'total'              => $query->max_num_pages,
97 97
 		]);
98 98
 	}
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
 	/**
101 101
 	 * @return mixed
102 102
 	 */
103
-	protected function getImagesPerPage( array $args )
103
+	protected function getImagesPerPage(array $args)
104 104
 	{
105
-		$args = $this->normalizeArgs( $args );
105
+		$args = $this->normalizeArgs($args);
106 106
 
107
-		return $this->postmeta->get( $args['per_page'], [
107
+		return $this->postmeta->get($args['per_page'], [
108 108
 			'fallback' => -1,
109 109
 		]);
110 110
 	}
@@ -114,20 +114,20 @@  discard block
 block discarded – undo
114 114
 	 *
115 115
 	 * @return null|object
116 116
 	 */
117
-	protected function getImageSrc( $id )
117
+	protected function getImageSrc($id)
118 118
 	{
119
-		$thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' );
119
+		$thumbnail = wp_get_attachment_image_src($id, 'thumbnail');
120 120
 
121
-		if( !$thumbnail )return;
121
+		if (!$thumbnail)return;
122 122
 
123
-		$medium = $this->normalizeImageSrc( wp_get_attachment_image_src( $id, 'medium' ), $thumbnail );
124
-		$large = $this->normalizeImageSrc( wp_get_attachment_image_src( $id, 'large' ), $medium );
123
+		$medium = $this->normalizeImageSrc(wp_get_attachment_image_src($id, 'medium'), $thumbnail);
124
+		$large = $this->normalizeImageSrc(wp_get_attachment_image_src($id, 'large'), $medium);
125 125
 
126 126
 		return (object) [
127
-			'alt'       => trim( strip_tags( get_post_meta( $id, '_wp_attachment_image_alt', true ))),
128
-			'caption'   => wp_get_attachment_caption( $id ),
129
-			'copyright' => trim( strip_tags( get_post_meta( $id, '_copyright', true ))),
130
-			'thumbnail' => $this->normalizeImageSrc( $thumbnail ),
127
+			'alt'       => trim(strip_tags(get_post_meta($id, '_wp_attachment_image_alt', true))),
128
+			'caption'   => wp_get_attachment_caption($id),
129
+			'copyright' => trim(strip_tags(get_post_meta($id, '_copyright', true))),
130
+			'thumbnail' => $this->normalizeImageSrc($thumbnail),
131 131
 			'medium'    => $medium,
132 132
 			'large'     => $large,
133 133
 		];
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
 	/**
137 137
 	 * @return array
138 138
 	 */
139
-	protected function getMediaIds( array $args )
139
+	protected function getMediaIds(array $args)
140 140
 	{
141
-		$args = $this->normalizeArgs( $args );
141
+		$args = $this->normalizeArgs($args);
142 142
 
143
-		return wp_parse_id_list( $this->postmeta->get( $args['media'], [
144
-			'ID'     => $this->postmeta->get( $args['gallery'] ),
143
+		return wp_parse_id_list($this->postmeta->get($args['media'], [
144
+			'ID'     => $this->postmeta->get($args['gallery']),
145 145
 			'single' => false,
146 146
 		]));
147 147
 	}
@@ -151,15 +151,15 @@  discard block
 block discarded – undo
151 151
 	 */
152 152
 	protected function getPaged()
153 153
 	{
154
-		return intval( get_query_var(( is_front_page() ? 'page' : 'paged' ))) ?: 1;
154
+		return intval(get_query_var((is_front_page() ? 'page' : 'paged'))) ?: 1;
155 155
 	}
156 156
 
157 157
 	/**
158 158
 	 * @return string
159 159
 	 */
160
-	protected function getPhotoswipeData( $image )
160
+	protected function getPhotoswipeData($image)
161 161
 	{
162
-		return sprintf( '{"l":{"src":"%s","w":%d,"h":%d},"m":{"src":"%s","w":%d,"h":%d}}',
162
+		return sprintf('{"l":{"src":"%s","w":%d,"h":%d},"m":{"src":"%s","w":%d,"h":%d}}',
163 163
 			$image->large['url'],
164 164
 			$image->large['width'],
165 165
 			$image->large['height'],
@@ -172,13 +172,13 @@  discard block
 block discarded – undo
172 172
 	/**
173 173
 	 * @return array
174 174
 	 */
175
-	protected function normalizeArgs( array $args = [] )
175
+	protected function normalizeArgs(array $args = [])
176 176
 	{
177 177
 		return shortcode_atts([
178 178
 			'gallery'  => 'gallery',
179 179
 			'media'    => 'media',
180 180
 			'per_page' => 'per_page',
181
-		], $args );
181
+		], $args);
182 182
 	}
183 183
 
184 184
 	/**
@@ -186,9 +186,9 @@  discard block
 block discarded – undo
186 186
 	 *
187 187
 	 * @return array
188 188
 	 */
189
-	protected function normalizeImageSrc( array $image, $fallback = false )
189
+	protected function normalizeImageSrc(array $image, $fallback = false)
190 190
 	{
191
-		if( is_array( $fallback ) && count( array_diff( $image, $fallback )) < 2 ) {
191
+		if (is_array($fallback) && count(array_diff($image, $fallback)) < 2) {
192 192
 			$image = $fallback;
193 193
 		}
194 194
 		return [
Please login to merge, or discard this patch.
src/Application.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,29 +11,29 @@  discard block
 block discarded – undo
11 11
 	public function __construct()
12 12
 	{
13 13
 		Facade::clearResolvedInstances();
14
-		Facade::setFacadeApplication( $this );
14
+		Facade::setFacadeApplication($this);
15 15
 		$this->registerAliases();
16 16
 	}
17 17
 
18 18
 	public function init()
19 19
 	{
20
-		$controller = $this->make( 'Controller' );
20
+		$controller = $this->make('Controller');
21 21
 
22 22
 		// Action hooks
23
-		add_action( 'after_setup_theme',      [$controller, 'afterSetupTheme'], 20 );
24
-		add_action( 'login_head',             [$controller, 'login'] );
25
-		add_action( 'wp_enqueue_scripts',     [$controller, 'registerAssets'] );
26
-		add_action( 'customize_register',     [$controller, 'registerCustomizer'] );
27
-		add_action( 'customize_preview_init', [$controller, 'registerCustomizerAssets'] );
28
-		add_action( 'widgets_init',           [$controller, 'registerSidebars'] );
23
+		add_action('after_setup_theme', [$controller, 'afterSetupTheme'], 20);
24
+		add_action('login_head', [$controller, 'login']);
25
+		add_action('wp_enqueue_scripts', [$controller, 'registerAssets']);
26
+		add_action('customize_register', [$controller, 'registerCustomizer']);
27
+		add_action('customize_preview_init', [$controller, 'registerCustomizerAssets']);
28
+		add_action('widgets_init', [$controller, 'registerSidebars']);
29 29
 
30 30
 		// Filter hooks
31
-		add_filter( 'template_include',       [$controller, 'filterTemplate'] );
32
-		add_filter( 'login_headertitle',      [$controller, 'filterLoginTitle'] );
33
-		add_filter( 'login_headerurl',        [$controller, 'filterLoginUrl'] );
31
+		add_filter('template_include', [$controller, 'filterTemplate']);
32
+		add_filter('login_headertitle', [$controller, 'filterLoginTitle']);
33
+		add_filter('login_headerurl', [$controller, 'filterLoginUrl']);
34 34
 
35
-		foreach( $this->getTemplateTypes() as $type ) {
36
-			add_filter( "{$type}_template_hierarchy", [$controller, 'filterTemplateHierarchy'] );
35
+		foreach ($this->getTemplateTypes() as $type) {
36
+			add_filter("{$type}_template_hierarchy", [$controller, 'filterTemplateHierarchy']);
37 37
 		}
38 38
 	}
39 39
 
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
 			'Utility'     => Facades\Utility::class,
52 52
 		];
53 53
 
54
-		$aliases = apply_filters( 'castor/register/aliases', $aliases );
54
+		$aliases = apply_filters('castor/register/aliases', $aliases);
55 55
 
56
-		AliasLoader::getInstance( $aliases )->register();
56
+		AliasLoader::getInstance($aliases)->register();
57 57
 	}
58 58
 
59 59
 	/**
Please login to merge, or discard this patch.
src/Controller.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -16,24 +16,24 @@  discard block
 block discarded – undo
16 16
 	 */
17 17
 	public function afterSetupTheme()
18 18
 	{
19
-		add_editor_style( Theme::assetUri( 'css/editor.css' ));
20
-		add_theme_support( 'customize-selective-refresh-widgets' );
21
-		add_theme_support( 'html5', ['caption', 'comment-form', 'comment-list', 'gallery', 'search-form'] );
22
-		add_theme_support( 'post-thumbnails' );
23
-		add_theme_support( 'soil-clean-up' );
24
-		add_theme_support( 'soil-jquery-cdn' );
25
-		add_theme_support( 'soil-nav-walker' );
26
-		add_theme_support( 'soil-nice-search' );
27
-		add_theme_support( 'soil-relative-urls' );
28
-		add_theme_support( 'title-tag' );
29
-		load_theme_textdomain( 'castor', Theme::paths( 'dir.template' ) . '/languages' );
30
-
31
-		$menus = apply_filters( 'castor/register/nav_menus', [
32
-			'main_menu' => __( 'Main Menu', 'castor' ),
19
+		add_editor_style(Theme::assetUri('css/editor.css'));
20
+		add_theme_support('customize-selective-refresh-widgets');
21
+		add_theme_support('html5', ['caption', 'comment-form', 'comment-list', 'gallery', 'search-form']);
22
+		add_theme_support('post-thumbnails');
23
+		add_theme_support('soil-clean-up');
24
+		add_theme_support('soil-jquery-cdn');
25
+		add_theme_support('soil-nav-walker');
26
+		add_theme_support('soil-nice-search');
27
+		add_theme_support('soil-relative-urls');
28
+		add_theme_support('title-tag');
29
+		load_theme_textdomain('castor', Theme::paths('dir.template') . '/languages');
30
+
31
+		$menus = apply_filters('castor/register/nav_menus', [
32
+			'main_menu' => __('Main Menu', 'castor'),
33 33
 		]);
34 34
 
35
-		foreach( $menus as $location => $description ) {
36
-			register_nav_menu( $location, $description );
35
+		foreach ($menus as $location => $description) {
36
+			register_nav_menu($location, $description);
37 37
 		}
38 38
 	}
39 39
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function filterLoginTitle()
45 45
 	{
46
-		return get_bloginfo( 'name' );
46
+		return get_bloginfo('name');
47 47
 	}
48 48
 
49 49
 	/**
@@ -52,18 +52,18 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	public function filterLoginUrl()
54 54
 	{
55
-		return get_bloginfo( 'url' );
55
+		return get_bloginfo('url');
56 56
 	}
57 57
 
58 58
 	/**
59 59
 	 * @return string
60 60
 	 * @filter template_include
61 61
 	 */
62
-	public function filterTemplate( $template )
62
+	public function filterTemplate($template)
63 63
 	{
64
-		if( is_string( $template )) {
65
-			$template = Template::setLayout( $template );
66
-			Development::storeTemplatePath( $template );
64
+		if (is_string($template)) {
65
+			$template = Template::setLayout($template);
66
+			Development::storeTemplatePath($template);
67 67
 		}
68 68
 		return $template;
69 69
 	}
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
 	 * @return array
73 73
 	 * @filter {$type}_template_hierarchy
74 74
 	 */
75
-	public function filterTemplateHierarchy( array $templates )
75
+	public function filterTemplateHierarchy(array $templates)
76 76
 	{
77
-		return array_map( function( $template ) {
78
-			return Utility::startWith( 'templates/', $template );
79
-		}, $templates );
77
+		return array_map(function($template) {
78
+			return Utility::startWith('templates/', $template);
79
+		}, $templates);
80 80
 	}
81 81
 
82 82
 	/**
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	public function login()
87 87
 	{
88
-		if( file_exists( Theme::assetPath( 'css/login.css' ))) {
89
-			printf( '<link rel="stylesheet" href="%s">', Theme::assetUri( 'css/login.css' ));
88
+		if (file_exists(Theme::assetPath('css/login.css'))) {
89
+			printf('<link rel="stylesheet" href="%s">', Theme::assetUri('css/login.css'));
90 90
 		}
91 91
 	}
92 92
 
@@ -96,21 +96,21 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	public function registerAssets()
98 98
 	{
99
-		wp_enqueue_style( 'castor/main.css', Theme::assetUri( 'css/main.css' ), [], null );
100
-		wp_enqueue_script( 'castor/main.js', Theme::assetUri( 'js/main.js' ), [], null, true );
99
+		wp_enqueue_style('castor/main.css', Theme::assetUri('css/main.css'), [], null);
100
+		wp_enqueue_script('castor/main.js', Theme::assetUri('js/main.js'), [], null, true);
101 101
 	}
102 102
 
103 103
 	/**
104 104
 	 * @return void
105 105
 	 * @action customize_register
106 106
 	 */
107
-	public function registerCustomizer( WP_Customize_Manager $manager )
107
+	public function registerCustomizer(WP_Customize_Manager $manager)
108 108
 	{
109
-		$manager->get_setting( 'blogname' )->transport = 'postMessage';
110
-		$manager->selective_refresh->add_partial( 'blogname', [
109
+		$manager->get_setting('blogname')->transport = 'postMessage';
110
+		$manager->selective_refresh->add_partial('blogname', [
111 111
 			'selector'        => '.brand',
112 112
 			'render_callback' => function() {
113
-				bloginfo( 'name' );
113
+				bloginfo('name');
114 114
 			},
115 115
 		]);
116 116
 	}
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public function registerCustomizerAssets()
123 123
 	{
124
-		wp_enqueue_script( 'castor/customizer.js', Theme::assetUri( 'js/customizer.js' ), ['customize-preview'], null, true );
124
+		wp_enqueue_script('castor/customizer.js', Theme::assetUri('js/customizer.js'), ['customize-preview'], null, true);
125 125
 	}
126 126
 
127 127
 	/**
@@ -130,23 +130,23 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	public function registerSidebars()
132 132
 	{
133
-		$defaults = apply_filters( 'castor/register/sidebars/defaults', [
133
+		$defaults = apply_filters('castor/register/sidebars/defaults', [
134 134
 			'before_widget' => '<div class="widget %1$s %2$s">',
135 135
 			'after_widget'  => '</div>',
136 136
 			'before_title'  => '<h4>',
137 137
 			'after_title'   => '</h4>',
138 138
 		]);
139 139
 
140
-		$sidebars = apply_filters( 'castor/register/sidebars', [
141
-			'sidebar-primary' => __( 'Primary Sidebar', 'castor' ),
142
-			'sidebar-footer'  => __( 'Footer Sidebar', 'castor' ),
140
+		$sidebars = apply_filters('castor/register/sidebars', [
141
+			'sidebar-primary' => __('Primary Sidebar', 'castor'),
142
+			'sidebar-footer'  => __('Footer Sidebar', 'castor'),
143 143
 		]);
144 144
 
145
-		foreach( $sidebars as $id => $name ) {
145
+		foreach ($sidebars as $id => $name) {
146 146
 			register_sidebar([
147 147
 				'id'   => $id,
148 148
 				'name' => $name,
149
-			] + $defaults );
149
+			] + $defaults);
150 150
 		}
151 151
 	}
152 152
 }
Please login to merge, or discard this patch.
castor.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,24 +1,24 @@
 block discarded – undo
1
-<?php defined( 'WPINC' ) || die;
1
+<?php defined('WPINC') || die;
2 2
 
3 3
 global $wp_version;
4 4
 
5
-if( version_compare( '5.6.0', phpversion(), '>=' )) {
5
+if (version_compare('5.6.0', phpversion(), '>=')) {
6 6
 	wp_die(
7
-		__( 'You must be using PHP 5.6.0 or greater.', 'castor' ),
8
-		__( 'Unsupported PHP version', 'castor' )
7
+		__('You must be using PHP 5.6.0 or greater.', 'castor'),
8
+		__('Unsupported PHP version', 'castor')
9 9
 	);
10 10
 }
11 11
 
12
-if( version_compare( '4.7.0', $wp_version, '>=' )) {
12
+if (version_compare('4.7.0', $wp_version, '>=')) {
13 13
 	wp_die(
14
-		__( 'You must be using WordPress 4.7.0 or greater.', 'castor' ),
15
-		__( 'Unsupported WordPress version', 'castor' )
14
+		__('You must be using WordPress 4.7.0 or greater.', 'castor'),
15
+		__('Unsupported WordPress version', 'castor')
16 16
 	);
17 17
 }
18 18
 
19
-if( is_customize_preview() && filter_input( INPUT_GET, 'theme' )) {
19
+if (is_customize_preview() && filter_input(INPUT_GET, 'theme')) {
20 20
 	wp_die(
21
-		__( 'Theme must be activated prior to using the customizer.', 'castor' )
21
+		__('Theme must be activated prior to using the customizer.', 'castor')
22 22
 	);
23 23
 }
24 24
 
Please login to merge, or discard this patch.