@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | use Composer\Script\Event; |
6 | 6 | |
7 | 7 | class Installer { |
8 | - public static $KEYS = array( |
|
8 | + public static $KEYS = array( |
|
9 | 9 | 'AUTH_KEY', |
10 | 10 | 'SECURE_AUTH_KEY', |
11 | 11 | 'LOGGED_IN_KEY', |
@@ -14,51 +14,51 @@ discard block |
||
14 | 14 | 'SECURE_AUTH_SALT', |
15 | 15 | 'LOGGED_IN_SALT', |
16 | 16 | 'NONCE_SALT' |
17 | - ); |
|
17 | + ); |
|
18 | 18 | |
19 | - public static function addSalts(Event $event) { |
|
19 | + public static function addSalts(Event $event) { |
|
20 | 20 | $root = dirname(dirname(dirname(__DIR__))); |
21 | 21 | $composer = $event->getComposer(); |
22 | 22 | $io = $event->getIO(); |
23 | 23 | |
24 | 24 | if (!$io->isInteractive()) { |
25 | - $generate_salts = $composer->getConfig()->get('generate-salts'); |
|
25 | + $generate_salts = $composer->getConfig()->get('generate-salts'); |
|
26 | 26 | } else { |
27 | - $generate_salts = $io->askConfirmation('<info>Generate salts and append to .env file?</info> [<comment>Y,n</comment>]? ', true); |
|
27 | + $generate_salts = $io->askConfirmation('<info>Generate salts and append to .env file?</info> [<comment>Y,n</comment>]? ', true); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | if (!$generate_salts) { |
31 | - return 1; |
|
31 | + return 1; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | $salts = array_map(function ($key) { |
35 | - return sprintf("%s='%s'", $key, Installer::generateSalt()); |
|
35 | + return sprintf("%s='%s'", $key, Installer::generateSalt()); |
|
36 | 36 | }, self::$KEYS); |
37 | 37 | |
38 | 38 | $env_file = "{$root}/.env"; |
39 | 39 | |
40 | 40 | if (copy("{$root}/.env.example", $env_file)) { |
41 | - file_put_contents($env_file, implode($salts, "\n"), FILE_APPEND | LOCK_EX); |
|
41 | + file_put_contents($env_file, implode($salts, "\n"), FILE_APPEND | LOCK_EX); |
|
42 | 42 | } else { |
43 | - $io->write("<error>An error occured while copying your .env file</error>"); |
|
44 | - return 1; |
|
43 | + $io->write("<error>An error occured while copying your .env file</error>"); |
|
44 | + return 1; |
|
45 | + } |
|
45 | 46 | } |
46 | - } |
|
47 | 47 | |
48 | - /** |
|
49 | - * Slightly modified/simpler version of wp_generate_password |
|
50 | - * https://github.com/WordPress/WordPress/blob/cd8cedc40d768e9e1d5a5f5a08f1bd677c804cb9/wp-includes/pluggable.php#L1575 |
|
51 | - */ |
|
52 | - public static function generateSalt($length = 64) { |
|
48 | + /** |
|
49 | + * Slightly modified/simpler version of wp_generate_password |
|
50 | + * https://github.com/WordPress/WordPress/blob/cd8cedc40d768e9e1d5a5f5a08f1bd677c804cb9/wp-includes/pluggable.php#L1575 |
|
51 | + */ |
|
52 | + public static function generateSalt($length = 64) { |
|
53 | 53 | $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; |
54 | 54 | $chars .= '!@#$%^&*()'; |
55 | 55 | $chars .= '-_ []{}<>~`+=,.;:/?|'; |
56 | 56 | |
57 | 57 | $salt = ''; |
58 | 58 | for ($i = 0; $i < $length; $i++) { |
59 | - $salt .= substr($chars, rand(0, strlen($chars) - 1), 1); |
|
59 | + $salt .= substr($chars, rand(0, strlen($chars) - 1), 1); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | return $salt; |
63 | - } |
|
63 | + } |
|
64 | 64 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | return 1; |
32 | 32 | } |
33 | 33 | |
34 | - $salts = array_map(function ($key) { |
|
34 | + $salts = array_map(function($key) { |
|
35 | 35 | return sprintf("%s='%s'", $key, Installer::generateSalt()); |
36 | 36 | }, self::$KEYS); |
37 | 37 |
@@ -1,97 +1,97 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Plugin Name: Bedrock Autoloader |
|
4 | - * Plugin URI: https://github.com/roots/bedrock/ |
|
5 | - * Description: An autoloader that enables standard plugins to be required just like must-use plugins. The autoloaded plugins are included during mu-plugin loading. An asterisk (*) next to the name of the plugin designates the plugins that have been autoloaded. |
|
6 | - * Version: 1.0.0 |
|
7 | - * Author: Roots |
|
8 | - * Author URI: https://roots.io/ |
|
9 | - * License: MIT License |
|
10 | - */ |
|
3 | + * Plugin Name: Bedrock Autoloader |
|
4 | + * Plugin URI: https://github.com/roots/bedrock/ |
|
5 | + * Description: An autoloader that enables standard plugins to be required just like must-use plugins. The autoloaded plugins are included during mu-plugin loading. An asterisk (*) next to the name of the plugin designates the plugins that have been autoloaded. |
|
6 | + * Version: 1.0.0 |
|
7 | + * Author: Roots |
|
8 | + * Author URI: https://roots.io/ |
|
9 | + * License: MIT License |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | namespace Roots\Bedrock; |
13 | 13 | |
14 | 14 | if (!is_blog_installed()) { return; } |
15 | 15 | |
16 | 16 | class Autoloader { |
17 | - private static $cache; // Stores our plugin cache and site option. |
|
18 | - private static $auto_plugins; // Contains the autoloaded plugins (only when needed). |
|
19 | - private static $mu_plugins; // Contains the mu plugins (only when needed). |
|
20 | - private static $count; // Contains the plugin count. |
|
21 | - private static $activated; // Newly activated plugins. |
|
22 | - private static $relative_path; // Relative path to the mu-plugins dir. |
|
23 | - private static $_single; // Let's make this a singleton. |
|
24 | - |
|
25 | - public function __construct() { |
|
17 | + private static $cache; // Stores our plugin cache and site option. |
|
18 | + private static $auto_plugins; // Contains the autoloaded plugins (only when needed). |
|
19 | + private static $mu_plugins; // Contains the mu plugins (only when needed). |
|
20 | + private static $count; // Contains the plugin count. |
|
21 | + private static $activated; // Newly activated plugins. |
|
22 | + private static $relative_path; // Relative path to the mu-plugins dir. |
|
23 | + private static $_single; // Let's make this a singleton. |
|
24 | + |
|
25 | + public function __construct() { |
|
26 | 26 | if (isset(self::$_single)) { return; } |
27 | 27 | |
28 | 28 | self::$_single = $this; // Singleton set. |
29 | 29 | self::$relative_path = '/../' . basename(__DIR__); // Rel path set. |
30 | 30 | |
31 | 31 | if (is_admin()) { |
32 | - add_filter('show_advanced_plugins', array($this, 'showInAdmin'), 0, 2); // Admin only filter. |
|
32 | + add_filter('show_advanced_plugins', array($this, 'showInAdmin'), 0, 2); // Admin only filter. |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $this->loadPlugins(); |
36 | - } |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * Run some checks then autoload our plugins. |
|
40 | - */ |
|
41 | - public function loadPlugins() { |
|
38 | + /** |
|
39 | + * Run some checks then autoload our plugins. |
|
40 | + */ |
|
41 | + public function loadPlugins() { |
|
42 | 42 | $this->checkCache(); |
43 | 43 | $this->validatePlugins(); |
44 | 44 | $this->countPlugins(); |
45 | 45 | |
46 | 46 | foreach (self::$cache['plugins'] as $plugin_file => $plugin_info) { |
47 | - include_once(WPMU_PLUGIN_DIR . '/' . $plugin_file); |
|
47 | + include_once(WPMU_PLUGIN_DIR . '/' . $plugin_file); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $this->pluginHooks(); |
51 | - } |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * Filter show_advanced_plugins to display the autoloaded plugins. |
|
55 | - */ |
|
56 | - public function showInAdmin($bool, $type) { |
|
53 | + /** |
|
54 | + * Filter show_advanced_plugins to display the autoloaded plugins. |
|
55 | + */ |
|
56 | + public function showInAdmin($bool, $type) { |
|
57 | 57 | $screen = get_current_screen(); |
58 | 58 | $current = is_multisite() ? 'plugins-network' : 'plugins'; |
59 | 59 | |
60 | 60 | if ($screen->{'base'} != $current || $type != 'mustuse' || !current_user_can('activate_plugins')) { |
61 | - return $bool; |
|
61 | + return $bool; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $this->updateCache(); // May as well update the transient cache whilst here. |
65 | 65 | |
66 | 66 | self::$auto_plugins = array_map(function ($auto_plugin) { |
67 | - $auto_plugin['Name'] .= ' *'; |
|
68 | - return $auto_plugin; |
|
67 | + $auto_plugin['Name'] .= ' *'; |
|
68 | + return $auto_plugin; |
|
69 | 69 | }, self::$auto_plugins); |
70 | 70 | |
71 | 71 | $GLOBALS['plugins']['mustuse'] = array_unique(array_merge(self::$auto_plugins, self::$mu_plugins), SORT_REGULAR); |
72 | 72 | |
73 | 73 | return false; // Prevent WordPress overriding our work. |
74 | - } |
|
74 | + } |
|
75 | 75 | |
76 | - /** |
|
77 | - * This sets the cache or calls for an update |
|
78 | - */ |
|
79 | - private function checkCache() { |
|
76 | + /** |
|
77 | + * This sets the cache or calls for an update |
|
78 | + */ |
|
79 | + private function checkCache() { |
|
80 | 80 | $cache = get_site_option('bedrock_autoloader'); |
81 | 81 | |
82 | 82 | if ($cache === false) { |
83 | - return $this->updateCache(); |
|
83 | + return $this->updateCache(); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | self::$cache = $cache; |
87 | - } |
|
88 | - |
|
89 | - /** |
|
90 | - * Get the plugins and mu-plugins from the mu-plugin path and remove duplicates. |
|
91 | - * Check cache against current plugins for newly activated plugins. |
|
92 | - * After that, we can update the cache. |
|
93 | - */ |
|
94 | - private function updateCache() { |
|
87 | + } |
|
88 | + |
|
89 | + /** |
|
90 | + * Get the plugins and mu-plugins from the mu-plugin path and remove duplicates. |
|
91 | + * Check cache against current plugins for newly activated plugins. |
|
92 | + * After that, we can update the cache. |
|
93 | + */ |
|
94 | + private function updateCache() { |
|
95 | 95 | require_once(ABSPATH . 'wp-admin/includes/plugin.php'); |
96 | 96 | |
97 | 97 | self::$auto_plugins = get_plugins(self::$relative_path); |
@@ -102,49 +102,49 @@ discard block |
||
102 | 102 | self::$cache = array('plugins' => $plugins, 'count' => $this->countPlugins()); |
103 | 103 | |
104 | 104 | update_site_option('bedrock_autoloader', self::$cache); |
105 | - } |
|
106 | - |
|
107 | - /** |
|
108 | - * This accounts for the plugin hooks that would run if the plugins were |
|
109 | - * loaded as usual. Plugins are removed by deletion, so there's no way |
|
110 | - * to deactivate or uninstall. |
|
111 | - */ |
|
112 | - private function pluginHooks() { |
|
105 | + } |
|
106 | + |
|
107 | + /** |
|
108 | + * This accounts for the plugin hooks that would run if the plugins were |
|
109 | + * loaded as usual. Plugins are removed by deletion, so there's no way |
|
110 | + * to deactivate or uninstall. |
|
111 | + */ |
|
112 | + private function pluginHooks() { |
|
113 | 113 | if (!is_array(self::$activated)) { return; } |
114 | 114 | |
115 | 115 | foreach (self::$activated as $plugin_file => $plugin_info) { |
116 | - do_action('activate_' . $plugin_file); |
|
116 | + do_action('activate_' . $plugin_file); |
|
117 | + } |
|
117 | 118 | } |
118 | - } |
|
119 | 119 | |
120 | - /** |
|
121 | - * Check that the plugin file exists, if it doesn't update the cache. |
|
122 | - */ |
|
123 | - private function validatePlugins() { |
|
120 | + /** |
|
121 | + * Check that the plugin file exists, if it doesn't update the cache. |
|
122 | + */ |
|
123 | + private function validatePlugins() { |
|
124 | 124 | foreach (self::$cache['plugins'] as $plugin_file => $plugin_info) { |
125 | - if (!file_exists(WPMU_PLUGIN_DIR . '/' . $plugin_file)) { |
|
125 | + if (!file_exists(WPMU_PLUGIN_DIR . '/' . $plugin_file)) { |
|
126 | 126 | $this->updateCache(); |
127 | 127 | break; |
128 | - } |
|
128 | + } |
|
129 | + } |
|
129 | 130 | } |
130 | - } |
|
131 | 131 | |
132 | - /** |
|
133 | - * Count our plugins (but only once) by counting the top level folders in the |
|
134 | - * mu-plugins dir. If it's more or less than last time, update the cache. |
|
135 | - */ |
|
136 | - private function countPlugins() { |
|
132 | + /** |
|
133 | + * Count our plugins (but only once) by counting the top level folders in the |
|
134 | + * mu-plugins dir. If it's more or less than last time, update the cache. |
|
135 | + */ |
|
136 | + private function countPlugins() { |
|
137 | 137 | if (isset(self::$count)) { return self::$count; } |
138 | 138 | |
139 | 139 | $count = count(glob(WPMU_PLUGIN_DIR . '/*/', GLOB_ONLYDIR | GLOB_NOSORT)); |
140 | 140 | |
141 | 141 | if (!isset(self::$cache['count']) || $count != self::$cache['count']) { |
142 | - self::$count = $count; |
|
143 | - $this->updateCache(); |
|
142 | + self::$count = $count; |
|
143 | + $this->updateCache(); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | return self::$count; |
147 | - } |
|
147 | + } |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | new Autoloader(); |
@@ -63,7 +63,7 @@ |
||
63 | 63 | |
64 | 64 | $this->updateCache(); // May as well update the transient cache whilst here. |
65 | 65 | |
66 | - self::$auto_plugins = array_map(function ($auto_plugin) { |
|
66 | + self::$auto_plugins = array_map(function($auto_plugin) { |
|
67 | 67 | $auto_plugin['Name'] .= ' *'; |
68 | 68 | return $auto_plugin; |
69 | 69 | }, self::$auto_plugins); |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template for displaying 404 pages (Not Found) |
|
4 | - * |
|
5 | - * Methods for TimberHelper can be found in the /functions sub-directory |
|
6 | - * |
|
7 | - * @package WordPress |
|
8 | - * @subpackage Timber |
|
9 | - * @since Timber 0.1 |
|
10 | - */ |
|
3 | + * The template for displaying 404 pages (Not Found) |
|
4 | + * |
|
5 | + * Methods for TimberHelper can be found in the /functions sub-directory |
|
6 | + * |
|
7 | + * @package WordPress |
|
8 | + * @subpackage Timber |
|
9 | + * @since Timber 0.1 |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | $context = Timber::get_context(); |
13 | 13 | Timber::render( '404.twig', $context ); |
@@ -10,4 +10,4 @@ |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | $context = Timber::get_context(); |
13 | -Timber::render( '404.twig', $context ); |
|
13 | +Timber::render('404.twig', $context); |
@@ -20,19 +20,19 @@ |
||
20 | 20 | |
21 | 21 | $data['title'] = 'Archive'; |
22 | 22 | if ( is_day() ) { |
23 | - $data['title'] = 'Archive: '.get_the_date( 'D M Y' ); |
|
23 | + $data['title'] = 'Archive: '.get_the_date( 'D M Y' ); |
|
24 | 24 | } else if ( is_month() ) { |
25 | - $data['title'] = 'Archive: '.get_the_date( 'M Y' ); |
|
25 | + $data['title'] = 'Archive: '.get_the_date( 'M Y' ); |
|
26 | 26 | } else if ( is_year() ) { |
27 | - $data['title'] = 'Archive: '.get_the_date( 'Y' ); |
|
27 | + $data['title'] = 'Archive: '.get_the_date( 'Y' ); |
|
28 | 28 | } else if ( is_tag() ) { |
29 | - $data['title'] = single_tag_title( '', false ); |
|
29 | + $data['title'] = single_tag_title( '', false ); |
|
30 | 30 | } else if ( is_category() ) { |
31 | - $data['title'] = single_cat_title( '', false ); |
|
32 | - array_unshift( $templates, 'archive-' . get_query_var( 'cat' ) . '.twig' ); |
|
31 | + $data['title'] = single_cat_title( '', false ); |
|
32 | + array_unshift( $templates, 'archive-' . get_query_var( 'cat' ) . '.twig' ); |
|
33 | 33 | } else if ( is_post_type_archive() ) { |
34 | - $data['title'] = post_type_archive_title( '', false ); |
|
35 | - array_unshift( $templates, 'archive-' . get_post_type() . '.twig' ); |
|
34 | + $data['title'] = post_type_archive_title( '', false ); |
|
35 | + array_unshift( $templates, 'archive-' . get_post_type() . '.twig' ); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $data['posts'] = Timber::get_posts(); |
@@ -14,27 +14,27 @@ |
||
14 | 14 | * @since Timber 0.2 |
15 | 15 | */ |
16 | 16 | |
17 | -$templates = array( 'archive.twig', 'index.twig' ); |
|
17 | +$templates = array('archive.twig', 'index.twig'); |
|
18 | 18 | |
19 | 19 | $data = Timber::get_context(); |
20 | 20 | |
21 | 21 | $data['title'] = 'Archive'; |
22 | -if ( is_day() ) { |
|
23 | - $data['title'] = 'Archive: '.get_the_date( 'D M Y' ); |
|
24 | -} else if ( is_month() ) { |
|
25 | - $data['title'] = 'Archive: '.get_the_date( 'M Y' ); |
|
26 | -} else if ( is_year() ) { |
|
27 | - $data['title'] = 'Archive: '.get_the_date( 'Y' ); |
|
28 | -} else if ( is_tag() ) { |
|
29 | - $data['title'] = single_tag_title( '', false ); |
|
30 | -} else if ( is_category() ) { |
|
31 | - $data['title'] = single_cat_title( '', false ); |
|
32 | - array_unshift( $templates, 'archive-' . get_query_var( 'cat' ) . '.twig' ); |
|
33 | -} else if ( is_post_type_archive() ) { |
|
34 | - $data['title'] = post_type_archive_title( '', false ); |
|
35 | - array_unshift( $templates, 'archive-' . get_post_type() . '.twig' ); |
|
22 | +if (is_day()) { |
|
23 | + $data['title'] = 'Archive: ' . get_the_date('D M Y'); |
|
24 | +} else if (is_month()) { |
|
25 | + $data['title'] = 'Archive: ' . get_the_date('M Y'); |
|
26 | +} else if (is_year()) { |
|
27 | + $data['title'] = 'Archive: ' . get_the_date('Y'); |
|
28 | +} else if (is_tag()) { |
|
29 | + $data['title'] = single_tag_title('', false); |
|
30 | +} else if (is_category()) { |
|
31 | + $data['title'] = single_cat_title('', false); |
|
32 | + array_unshift($templates, 'archive-' . get_query_var('cat') . '.twig'); |
|
33 | +} else if (is_post_type_archive()) { |
|
34 | + $data['title'] = post_type_archive_title('', false); |
|
35 | + array_unshift($templates, 'archive-' . get_post_type() . '.twig'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $data['posts'] = Timber::get_posts(); |
39 | 39 | |
40 | -Timber::render( $templates, $data ); |
|
40 | +Timber::render($templates, $data); |
@@ -13,8 +13,8 @@ |
||
13 | 13 | $data = Timber::get_context(); |
14 | 14 | $data['posts'] = Timber::get_posts(); |
15 | 15 | if ( isset( $wp_query->query_vars['author'] ) ) { |
16 | - $author = new TimberUser( $wp_query->query_vars['author'] ); |
|
17 | - $data['author'] = $author; |
|
18 | - $data['title'] = 'Author Archives: ' . $author->name(); |
|
16 | + $author = new TimberUser( $wp_query->query_vars['author'] ); |
|
17 | + $data['author'] = $author; |
|
18 | + $data['title'] = 'Author Archives: ' . $author->name(); |
|
19 | 19 | } |
20 | 20 | Timber::render( array( 'author.twig', 'archive.twig' ), $data ); |
@@ -12,9 +12,9 @@ |
||
12 | 12 | |
13 | 13 | $data = Timber::get_context(); |
14 | 14 | $data['posts'] = Timber::get_posts(); |
15 | -if ( isset( $wp_query->query_vars['author'] ) ) { |
|
16 | - $author = new TimberUser( $wp_query->query_vars['author'] ); |
|
15 | +if (isset($wp_query->query_vars['author'])) { |
|
16 | + $author = new TimberUser($wp_query->query_vars['author']); |
|
17 | 17 | $data['author'] = $author; |
18 | 18 | $data['title'] = 'Author Archives: ' . $author->name(); |
19 | 19 | } |
20 | -Timber::render( array( 'author.twig', 'archive.twig' ), $data ); |
|
20 | +Timber::render(array('author.twig', 'archive.twig'), $data); |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template for displaying comments. |
|
4 | - * |
|
5 | - * The area of the page that contains both current comments |
|
6 | - * and the comment form. |
|
7 | - * |
|
8 | - * @package stash |
|
9 | - */ |
|
3 | + * The template for displaying comments. |
|
4 | + * |
|
5 | + * The area of the page that contains both current comments |
|
6 | + * and the comment form. |
|
7 | + * |
|
8 | + * @package stash |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | /* |
12 | 12 | * If the current post is protected by a password and |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * return early without loading the comments. |
15 | 15 | */ |
16 | 16 | if ( post_password_required() ) { |
17 | - return; |
|
17 | + return; |
|
18 | 18 | } |
19 | 19 | ?> |
20 | 20 | |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | <?php if ( have_comments() ) : ?> |
26 | 26 | <h2 class="comments-title"> |
27 | 27 | <?php |
28 | - printf( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'stash' ), |
|
29 | - number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); |
|
30 | - ?> |
|
28 | + printf( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'stash' ), |
|
29 | + number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); |
|
30 | + ?> |
|
31 | 31 | </h2> |
32 | 32 | |
33 | 33 | <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | |
45 | 45 | <ol class="comment-list"> |
46 | 46 | <?php |
47 | - wp_list_comments( array( |
|
48 | - 'style' => 'ol', |
|
49 | - 'short_ping' => true, |
|
50 | - ) ); |
|
51 | - ?> |
|
47 | + wp_list_comments( array( |
|
48 | + 'style' => 'ol', |
|
49 | + 'short_ping' => true, |
|
50 | + ) ); |
|
51 | + ?> |
|
52 | 52 | </ol><!-- .comment-list --> |
53 | 53 | |
54 | 54 | <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | <?php endif; // have_comments() ?> |
67 | 67 | |
68 | 68 | <?php |
69 | - // If comments are closed and there are comments, let's leave a little note, shall we? |
|
70 | - if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : |
|
71 | - ?> |
|
69 | + // If comments are closed and there are comments, let's leave a little note, shall we? |
|
70 | + if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : |
|
71 | + ?> |
|
72 | 72 | <p class="no-comments"><?php _e( 'Comments are closed.', 'stash' ); ?></p> |
73 | 73 | <?php endif; ?> |
74 | 74 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | * the visitor has not yet entered the password we will |
14 | 14 | * return early without loading the comments. |
15 | 15 | */ |
16 | -if ( post_password_required() ) { |
|
16 | +if (post_password_required()) { |
|
17 | 17 | return; |
18 | 18 | } |
19 | 19 | ?> |
@@ -22,21 +22,21 @@ discard block |
||
22 | 22 | |
23 | 23 | <?php // You can start editing here -- including this comment! ?> |
24 | 24 | |
25 | - <?php if ( have_comments() ) : ?> |
|
25 | + <?php if (have_comments()) : ?> |
|
26 | 26 | <h2 class="comments-title"> |
27 | 27 | <?php |
28 | - printf( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'stash' ), |
|
29 | - number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); |
|
28 | + printf(_nx('One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'stash'), |
|
29 | + number_format_i18n(get_comments_number()), '<span>' . get_the_title() . '</span>'); |
|
30 | 30 | ?> |
31 | 31 | </h2> |
32 | 32 | |
33 | - <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> |
|
33 | + <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : // are there comments to navigate through ?> |
|
34 | 34 | <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation"> |
35 | - <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'stash' ); ?></h2> |
|
35 | + <h2 class="screen-reader-text"><?php _e('Comment navigation', 'stash'); ?></h2> |
|
36 | 36 | <div class="nav-links"> |
37 | 37 | |
38 | - <div class="nav-previous"><?php previous_comments_link( __( 'Older Comments', 'stash' ) ); ?></div> |
|
39 | - <div class="nav-next"><?php next_comments_link( __( 'Newer Comments', 'stash' ) ); ?></div> |
|
38 | + <div class="nav-previous"><?php previous_comments_link(__('Older Comments', 'stash')); ?></div> |
|
39 | + <div class="nav-next"><?php next_comments_link(__('Newer Comments', 'stash')); ?></div> |
|
40 | 40 | |
41 | 41 | </div><!-- .nav-links --> |
42 | 42 | </nav><!-- #comment-nav-above --> |
@@ -44,20 +44,20 @@ discard block |
||
44 | 44 | |
45 | 45 | <ol class="comment-list"> |
46 | 46 | <?php |
47 | - wp_list_comments( array( |
|
47 | + wp_list_comments(array( |
|
48 | 48 | 'style' => 'ol', |
49 | 49 | 'short_ping' => true, |
50 | - ) ); |
|
50 | + )); |
|
51 | 51 | ?> |
52 | 52 | </ol><!-- .comment-list --> |
53 | 53 | |
54 | - <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> |
|
54 | + <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : // are there comments to navigate through ?> |
|
55 | 55 | <nav id="comment-nav-below" class="navigation comment-navigation" role="navigation"> |
56 | - <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'stash' ); ?></h2> |
|
56 | + <h2 class="screen-reader-text"><?php _e('Comment navigation', 'stash'); ?></h2> |
|
57 | 57 | <div class="nav-links"> |
58 | 58 | |
59 | - <div class="nav-previous"><?php previous_comments_link( __( 'Older Comments', 'stash' ) ); ?></div> |
|
60 | - <div class="nav-next"><?php next_comments_link( __( 'Newer Comments', 'stash' ) ); ?></div> |
|
59 | + <div class="nav-previous"><?php previous_comments_link(__('Older Comments', 'stash')); ?></div> |
|
60 | + <div class="nav-next"><?php next_comments_link(__('Newer Comments', 'stash')); ?></div> |
|
61 | 61 | |
62 | 62 | </div><!-- .nav-links --> |
63 | 63 | </nav><!-- #comment-nav-below --> |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | |
68 | 68 | <?php |
69 | 69 | // If comments are closed and there are comments, let's leave a little note, shall we? |
70 | - if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : |
|
70 | + if (!comments_open() && '0' != get_comments_number() && post_type_supports(get_post_type(), 'comments')) : |
|
71 | 71 | ?> |
72 | - <p class="no-comments"><?php _e( 'Comments are closed.', 'stash' ); ?></p> |
|
72 | + <p class="no-comments"><?php _e('Comments are closed.', 'stash'); ?></p> |
|
73 | 73 | <?php endif; ?> |
74 | 74 | |
75 | 75 | <?php comment_form(); ?> |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template part for displaying a message that posts cannot be found. |
|
4 | - * |
|
5 | - * Learn more: http://codex.wordpress.org/Template_Hierarchy |
|
6 | - * |
|
7 | - * @package stash |
|
8 | - */ |
|
3 | + * The template part for displaying a message that posts cannot be found. |
|
4 | + * |
|
5 | + * Learn more: http://codex.wordpress.org/Template_Hierarchy |
|
6 | + * |
|
7 | + * @package stash |
|
8 | + */ |
|
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <section class="no-results not-found"> |
@@ -10,22 +10,22 @@ |
||
10 | 10 | |
11 | 11 | <section class="no-results not-found"> |
12 | 12 | <header class="page-header"> |
13 | - <h1 class="page-title"><?php _e( 'Nothing Found', 'stash' ); ?></h1> |
|
13 | + <h1 class="page-title"><?php _e('Nothing Found', 'stash'); ?></h1> |
|
14 | 14 | </header><!-- .page-header --> |
15 | 15 | |
16 | 16 | <div class="page-content"> |
17 | - <?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?> |
|
17 | + <?php if (is_home() && current_user_can('publish_posts')) : ?> |
|
18 | 18 | |
19 | - <p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'stash' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p> |
|
19 | + <p><?php printf(__('Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'stash'), esc_url(admin_url('post-new.php'))); ?></p> |
|
20 | 20 | |
21 | - <?php elseif ( is_search() ) : ?> |
|
21 | + <?php elseif (is_search()) : ?> |
|
22 | 22 | |
23 | - <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'stash' ); ?></p> |
|
23 | + <p><?php _e('Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'stash'); ?></p> |
|
24 | 24 | <?php get_search_form(); ?> |
25 | 25 | |
26 | 26 | <?php else : ?> |
27 | 27 | |
28 | - <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'stash' ); ?></p> |
|
28 | + <p><?php _e('It seems we can’t find what you’re looking for. Perhaps searching can help.', 'stash'); ?></p> |
|
29 | 29 | <?php get_search_form(); ?> |
30 | 30 | |
31 | 31 | <?php endif; ?> |
@@ -23,9 +23,12 @@ |
||
23 | 23 | <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'stash' ); ?></p> |
24 | 24 | <?php get_search_form(); ?> |
25 | 25 | |
26 | - <?php else : ?> |
|
26 | + <?php else { |
|
27 | + : ?> |
|
27 | 28 | |
28 | - <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'stash' ); ?></p> |
|
29 | + <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'stash' ); |
|
30 | +} |
|
31 | +?></p> |
|
29 | 32 | <?php get_search_form(); ?> |
30 | 33 | |
31 | 34 | <?php endif; ?> |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template used for displaying page content in page.php |
|
4 | - * |
|
5 | - * @package stash |
|
6 | - */ |
|
3 | + * The template used for displaying page content in page.php |
|
4 | + * |
|
5 | + * @package stash |
|
6 | + */ |
|
7 | 7 | ?> |
8 | 8 | |
9 | 9 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
@@ -14,11 +14,11 @@ discard block |
||
14 | 14 | <div class="entry-content"> |
15 | 15 | <?php the_content(); ?> |
16 | 16 | <?php |
17 | - wp_link_pages( array( |
|
18 | - 'before' => '<div class="page-links">' . __( 'Pages:', 'stash' ), |
|
19 | - 'after' => '</div>', |
|
20 | - ) ); |
|
21 | - ?> |
|
17 | + wp_link_pages( array( |
|
18 | + 'before' => '<div class="page-links">' . __( 'Pages:', 'stash' ), |
|
19 | + 'after' => '</div>', |
|
20 | + ) ); |
|
21 | + ?> |
|
22 | 22 | </div><!-- .entry-content --> |
23 | 23 | |
24 | 24 | <footer class="entry-footer"> |
@@ -8,20 +8,20 @@ |
||
8 | 8 | |
9 | 9 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
10 | 10 | <header class="entry-header"> |
11 | - <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> |
|
11 | + <?php the_title('<h1 class="entry-title">', '</h1>'); ?> |
|
12 | 12 | </header><!-- .entry-header --> |
13 | 13 | |
14 | 14 | <div class="entry-content"> |
15 | 15 | <?php the_content(); ?> |
16 | 16 | <?php |
17 | - wp_link_pages( array( |
|
18 | - 'before' => '<div class="page-links">' . __( 'Pages:', 'stash' ), |
|
17 | + wp_link_pages(array( |
|
18 | + 'before' => '<div class="page-links">' . __('Pages:', 'stash'), |
|
19 | 19 | 'after' => '</div>', |
20 | - ) ); |
|
20 | + )); |
|
21 | 21 | ?> |
22 | 22 | </div><!-- .entry-content --> |
23 | 23 | |
24 | 24 | <footer class="entry-footer"> |
25 | - <?php edit_post_link( __( 'Edit', 'stash' ), '<span class="edit-link">', '</span>' ); ?> |
|
25 | + <?php edit_post_link(__('Edit', 'stash'), '<span class="edit-link">', '</span>'); ?> |
|
26 | 26 | </footer><!-- .entry-footer --> |
27 | 27 | </article><!-- #post-## --> |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template part for displaying results in search pages. |
|
4 | - * |
|
5 | - * Learn more: http://codex.wordpress.org/Template_Hierarchy |
|
6 | - * |
|
7 | - * @package stash |
|
8 | - */ |
|
3 | + * The template part for displaying results in search pages. |
|
4 | + * |
|
5 | + * Learn more: http://codex.wordpress.org/Template_Hierarchy |
|
6 | + * |
|
7 | + * @package stash |
|
8 | + */ |
|
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
@@ -10,9 +10,9 @@ |
||
10 | 10 | |
11 | 11 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
12 | 12 | <header class="entry-header"> |
13 | - <?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?> |
|
13 | + <?php the_title(sprintf('<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h1>'); ?> |
|
14 | 14 | |
15 | - <?php if ( 'post' == get_post_type() ) : ?> |
|
15 | + <?php if ('post' == get_post_type()) : ?> |
|
16 | 16 | <div class="entry-meta"> |
17 | 17 | <?php stash_posted_on(); ?> |
18 | 18 | </div><!-- .entry-meta --> |