From 62ff79941d99d25648b2c018c822ba0639ec1e40 Mon Sep 17 00:00:00 2001 From: Skylar Bolton Date: Wed, 10 Mar 2021 22:41:18 -0700 Subject: [PATCH 1/5] Allow parent theme to be selected for base location --- options.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/options.php b/options.php index 3044f29e..8f1cada7 100644 --- a/options.php +++ b/options.php @@ -88,7 +88,8 @@ public function page_init() 'name' => 'base_compiling_folder', 'type' => apply_filters( 'wp_scss_base_compiling_modes', array( - get_stylesheet_directory() => 'Current theme', + get_template_directory() => 'Parent theme (or current)', + get_stylesheet_directory() => 'Current theme (child if in use)', wp_get_upload_dir()['basedir'] => 'Uploads directory', WPSCSS_PLUGIN_DIR => 'WP-SCSS Plugin', ) From f008499ef38c46734341911c661fac2240f38930 Mon Sep 17 00:00:00 2001 From: Skylar Bolton Date: Sun, 9 May 2021 19:53:49 -0600 Subject: [PATCH 2/5] Add warning --- options.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options.php b/options.php index 8f1cada7..9a4bbf72 100644 --- a/options.php +++ b/options.php @@ -247,7 +247,7 @@ public function sanitize( $input ) { * Print the Section text */ public function print_paths_info() { - print 'Location of your SCSS/CSS folders. Folders must be nested under your Base Location and start with /.
Examples: /custom-scss/ and /custom-css/'; + print 'Location of your SCSS/CSS folders. Folders must be nested under your Base Location and start with /.
Examples: /custom-scss/ and /custom-css/
Caution: updating some themes or plugins can remove the custom WP-SCSS Base Location.'; } public function print_compile_info() { print 'Choose how you would like SCSS and source maps to be compiled and how you would like the plugin to handle errors'; From 465afb480da7c6b719cc8d6d562e58bcd9e8d1bb Mon Sep 17 00:00:00 2001 From: Skylar Bolton Date: Mon, 10 May 2021 02:00:20 +0000 Subject: [PATCH 3/5] Parent theme notes --- options.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/options.php b/options.php index 9a4bbf72..3977382c 100644 --- a/options.php +++ b/options.php @@ -88,8 +88,8 @@ public function page_init() 'name' => 'base_compiling_folder', 'type' => apply_filters( 'wp_scss_base_compiling_modes', array( - get_template_directory() => 'Parent theme (or current)', - get_stylesheet_directory() => 'Current theme (child if in use)', + get_template_directory() => 'Parent theme (or current)', // Won't display if no parent theme + get_stylesheet_directory() => 'Current theme (child theme *if* in use)', wp_get_upload_dir()['basedir'] => 'Uploads directory', WPSCSS_PLUGIN_DIR => 'WP-SCSS Plugin', ) From ead2f66e3ed1ab818cee9d77d36f613e1f0bd524 Mon Sep 17 00:00:00 2001 From: Skylar Bolton Date: Mon, 10 May 2021 02:11:12 +0000 Subject: [PATCH 4/5] Update comment about updating, Check to show correct theme when choosing base location --- options.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/options.php b/options.php index 3977382c..8388005d 100644 --- a/options.php +++ b/options.php @@ -88,8 +88,8 @@ public function page_init() 'name' => 'base_compiling_folder', 'type' => apply_filters( 'wp_scss_base_compiling_modes', array( - get_template_directory() => 'Parent theme (or current)', // Won't display if no parent theme - get_stylesheet_directory() => 'Current theme (child theme *if* in use)', + get_template_directory() => 'Parent theme', // Won't display if no parent theme as it would have duplicate keys in array + get_stylesheet_directory() => (get_stylesheet_directory() == get_template_directory() ? 'Current theme' : 'Child theme'), wp_get_upload_dir()['basedir'] => 'Uploads directory', WPSCSS_PLUGIN_DIR => 'WP-SCSS Plugin', ) @@ -247,7 +247,9 @@ public function sanitize( $input ) { * Print the Section text */ public function print_paths_info() { - print 'Location of your SCSS/CSS folders. Folders must be nested under your Base Location and start with /.
Examples: /custom-scss/ and /custom-css/
Caution: updating some themes or plugins can remove the custom WP-SCSS Base Location.'; + print 'Location of your SCSS/CSS folders. Folders must be nested under your Base Location and start with /.'+ + '
Examples: /custom-scss/ and /custom-css/'+ + '
Caution updating some themes or plugins will delete the custom WP-SCSS Base Location when nested.'; } public function print_compile_info() { print 'Choose how you would like SCSS and source maps to be compiled and how you would like the plugin to handle errors'; From f6a692c2b56506f59d362b868852255b7ce50615 Mon Sep 17 00:00:00 2001 From: Skylar Bolton Date: Sun, 9 May 2021 20:47:18 -0600 Subject: [PATCH 5/5] change == to === --- options.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options.php b/options.php index 8388005d..2bbcfefc 100644 --- a/options.php +++ b/options.php @@ -89,7 +89,7 @@ public function page_init() 'type' => apply_filters( 'wp_scss_base_compiling_modes', array( get_template_directory() => 'Parent theme', // Won't display if no parent theme as it would have duplicate keys in array - get_stylesheet_directory() => (get_stylesheet_directory() == get_template_directory() ? 'Current theme' : 'Child theme'), + get_stylesheet_directory() => (get_stylesheet_directory() === get_template_directory() ? 'Current theme' : 'Child theme'), wp_get_upload_dir()['basedir'] => 'Uploads directory', WPSCSS_PLUGIN_DIR => 'WP-SCSS Plugin', )