Version Description
- Added support for Parabola 1.6
- Added detection of supported themes when the theme folder is renamed
Download this release
Release Info
Developer | Cryout Creations |
Plugin | Cryout Serious Theme Settings |
Version | 0.5.5 |
Comparing to | |
See all releases |
Code changes from version 0.5.3 to 0.5.5
- cryout-theme-settings.php +38 -5
- inc/parabola.php +21 -0
- inc/settings.php +17 -3
- inc/tempera.php +0 -1
- readme.txt +28 -12
cryout-theme-settings.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Cryout Serious Theme Settings
|
4 |
Plugin URI: http://www.cryoutcreations.eu/serious-theme-settings
|
5 |
Description: This plugin is designed to restore our theme's settings page functionality after the enforcement of the Customize-based theme settings. It is only compatible with and will only function when one of our themes is active: Nirvana, Parabola or Tempera.
|
6 |
-
Version: 0.5.
|
7 |
Author: Cryout Creations
|
8 |
Author URI: http://www.cryoutcreations.eu
|
9 |
License: GPLv3
|
@@ -11,7 +11,7 @@
|
|
11 |
*/
|
12 |
|
13 |
class Cryout_Theme_Settings {
|
14 |
-
public $version = "0.5.
|
15 |
public $settings = array();
|
16 |
|
17 |
private $status = 0; // 0 = inactive, 1 = active, 2 = good theme, wrong version, 3 = wrong theme, 4 = compatibility for wp4.4
|
@@ -20,6 +20,7 @@ class Cryout_Theme_Settings {
|
|
20 |
'nirvana' => '1.2',
|
21 |
'tempera' => '1.4',
|
22 |
'parabola' => '1.6',
|
|
|
23 |
);
|
24 |
private $compatibility_themes = array(
|
25 |
'tempera' => '0.9',
|
@@ -29,6 +30,7 @@ class Cryout_Theme_Settings {
|
|
29 |
private $slug = 'cryout-theme-settings';
|
30 |
private $title = '';
|
31 |
public $current_theme = array();
|
|
|
32 |
|
33 |
public function __construct(){
|
34 |
add_action( 'init', array( $this, 'register' ) );
|
@@ -72,10 +74,41 @@ class Cryout_Theme_Settings {
|
|
72 |
$current_theme_slug = strtolower( wp_get_theme()->Template );
|
73 |
$current_theme_version = wp_get_theme($current_theme_slug)->Version;
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
$this->current_theme = array(
|
76 |
'slug' => $current_theme_slug,
|
77 |
'version' => $current_theme_version,
|
78 |
-
);
|
79 |
|
80 |
if (in_array( $current_theme_slug, array_keys( $this->supported_themes) )) {
|
81 |
// supported theme, check version
|
@@ -84,7 +117,7 @@ class Cryout_Theme_Settings {
|
|
84 |
$this->status = 1;
|
85 |
return 1;
|
86 |
elseif ( (version_compare( $current_theme_version, $this->compatibility_themes[$current_theme_slug] ) >=0 ) &&
|
87 |
-
(version_compare($wp_version, '4.
|
88 |
// compatibility mode
|
89 |
$this->status = 4;
|
90 |
return 4;
|
@@ -102,7 +135,7 @@ class Cryout_Theme_Settings {
|
|
102 |
} // supported_theme()
|
103 |
|
104 |
public function enqueue_script($hook) {
|
105 |
-
if ( $GLOBALS['plugin_page'] == $this->current_theme['slug'] . '-page' )
|
106 |
wp_enqueue_script( 'cryout-theme-settings-code', plugins_url( 'code.js', __FILE__ ), NULL, $this->version );
|
107 |
} // enqueue_script()
|
108 |
|
3 |
Plugin Name: Cryout Serious Theme Settings
|
4 |
Plugin URI: http://www.cryoutcreations.eu/serious-theme-settings
|
5 |
Description: This plugin is designed to restore our theme's settings page functionality after the enforcement of the Customize-based theme settings. It is only compatible with and will only function when one of our themes is active: Nirvana, Parabola or Tempera.
|
6 |
+
Version: 0.5.5
|
7 |
Author: Cryout Creations
|
8 |
Author URI: http://www.cryoutcreations.eu
|
9 |
License: GPLv3
|
11 |
*/
|
12 |
|
13 |
class Cryout_Theme_Settings {
|
14 |
+
public $version = "0.5.5";
|
15 |
public $settings = array();
|
16 |
|
17 |
private $status = 0; // 0 = inactive, 1 = active, 2 = good theme, wrong version, 3 = wrong theme, 4 = compatibility for wp4.4
|
20 |
'nirvana' => '1.2',
|
21 |
'tempera' => '1.4',
|
22 |
'parabola' => '1.6',
|
23 |
+
'mantra' => '3.0',
|
24 |
);
|
25 |
private $compatibility_themes = array(
|
26 |
'tempera' => '0.9',
|
30 |
private $slug = 'cryout-theme-settings';
|
31 |
private $title = '';
|
32 |
public $current_theme = array();
|
33 |
+
public $renamed_theme = false;
|
34 |
|
35 |
public function __construct(){
|
36 |
add_action( 'init', array( $this, 'register' ) );
|
74 |
$current_theme_slug = strtolower( wp_get_theme()->Template );
|
75 |
$current_theme_version = wp_get_theme($current_theme_slug)->Version;
|
76 |
|
77 |
+
if (!in_array( $current_theme_slug, array_keys( $this->supported_themes) )) {
|
78 |
+
// theme slug does not match supported themes
|
79 |
+
// perform additional checks for theme constants
|
80 |
+
|
81 |
+
if (defined('_CRYOUT_THEME_NAME')) {
|
82 |
+
if ($current_theme_slug != _CRYOUT_THEME_NAME) $this->renamed_theme = true;
|
83 |
+
$current_theme_slug = _CRYOUT_THEME_NAME;
|
84 |
+
if (defined('_CRYOUT_THEME_VERSION')) $current_theme_version = _CRYOUT_THEME_VERSION;
|
85 |
+
}
|
86 |
+
if (defined('MANTRA_VERSION')) {
|
87 |
+
if ($current_theme_slug != 'mantra') $this->renamed_theme = true;
|
88 |
+
$current_theme_slug = 'mantra';
|
89 |
+
$current_theme_version = MANTRA_VERSION;
|
90 |
+
}
|
91 |
+
if (defined('PARABOLA_VERSION')) {
|
92 |
+
if ($current_theme_slug != 'parabola') $this->renamed_theme = true;
|
93 |
+
$current_theme_slug = 'parabola';
|
94 |
+
$current_theme_version = PARABOLA_VERSION;
|
95 |
+
}
|
96 |
+
if (defined('TEMPERA_VERSION')) {
|
97 |
+
if ($current_theme_slug != 'tempera') $this->renamed_theme = true;
|
98 |
+
$current_theme_slug = 'tempera';
|
99 |
+
$current_theme_version = TEMPERA_VERSION;
|
100 |
+
}
|
101 |
+
if (defined('NIRVANA_VERSION')) {
|
102 |
+
if ($current_theme_slug != 'nirvana') $this->renamed_theme = true;
|
103 |
+
$current_theme_slug = 'nirvana';
|
104 |
+
$current_theme_version = NIRVANA_VERSION;
|
105 |
+
}
|
106 |
+
} // end additional checks
|
107 |
+
|
108 |
$this->current_theme = array(
|
109 |
'slug' => $current_theme_slug,
|
110 |
'version' => $current_theme_version,
|
111 |
+
);
|
112 |
|
113 |
if (in_array( $current_theme_slug, array_keys( $this->supported_themes) )) {
|
114 |
// supported theme, check version
|
117 |
$this->status = 1;
|
118 |
return 1;
|
119 |
elseif ( (version_compare( $current_theme_version, $this->compatibility_themes[$current_theme_slug] ) >=0 ) &&
|
120 |
+
(version_compare($wp_version, '4.3.9999') >= 0) ):
|
121 |
// compatibility mode
|
122 |
$this->status = 4;
|
123 |
return 4;
|
135 |
} // supported_theme()
|
136 |
|
137 |
public function enqueue_script($hook) {
|
138 |
+
if ( !empty($GLOBALS['plugin_page']) && ($GLOBALS['plugin_page'] == $this->current_theme['slug'] . '-page') )
|
139 |
wp_enqueue_script( 'cryout-theme-settings-code', plugins_url( 'code.js', __FILE__ ), NULL, $this->version );
|
140 |
} // enqueue_script()
|
141 |
|
inc/parabola.php
CHANGED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (function_exists('parabola_init_fn')):
|
3 |
+
add_action('admin_init', 'parabola_init_fn');
|
4 |
+
endif;
|
5 |
+
|
6 |
+
function parabola_theme_settings_restore($class='') {
|
7 |
+
global $cryout_theme_settings;
|
8 |
+
?>
|
9 |
+
<form name="parabola_form" action="options.php" method="post" enctype="multipart/form-data">
|
10 |
+
<div id="accordion">
|
11 |
+
<?php settings_fields('parabola_settings'); ?>
|
12 |
+
<?php do_settings_sections('parabola-page'); ?>
|
13 |
+
</div>
|
14 |
+
<div id="submitDiv">
|
15 |
+
<br>
|
16 |
+
<input class="button" name="parabola_settings[parabola_submit]" type="submit" style="float:right;" value="<?php _e('Save Changes','parabola'); ?>" />
|
17 |
+
<input class="button" name="parabola_settings[parabola_defaults]" id="parabola_defaults" type="submit" style="float:left;" value="<?php _e('Reset to Defaults','parabola'); ?>" />
|
18 |
+
</div>
|
19 |
+
</form>
|
20 |
+
<?php
|
21 |
+
} // parabola_theme_settings_buttons()
|
inc/settings.php
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
Navigate <a href="themes.php?page=<?php echo $this->current_theme['slug'] ?>-page"><strong>here</strong></a> to configure <?php echo ucwords($this->current_theme['slug']) ?>.
|
9 |
</p></div>
|
10 |
<?php elseif ($this->status == 4): ?>
|
11 |
-
<div class="updated"><p>Current active (or parent) theme is: <strong><?php echo ucwords($this->current_theme['slug']); ?></strong> and you are running
|
12 |
The plugin is <strong style="color: #008000;">active</strong> in compatibility mode.<br>
|
13 |
<br>
|
14 |
Navigate <a href="themes.php?page=<?php echo $this->current_theme['slug'] ?>-page"><strong>here</strong></a> to configure <?php echo ucwords($this->current_theme['slug']) ?>.
|
@@ -39,6 +39,12 @@
|
|
39 |
<?php endswitch; ?>
|
40 |
</p></div>
|
41 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
<div id="poststuff">
|
44 |
<div id="post-body" class="metabox-holder columns-2">
|
@@ -58,8 +64,16 @@
|
|
58 |
<li><a href="http://wordpress.org/themes/tempera" target="_blank">Tempera</a> version 1.4 and newer</li>
|
59 |
</ul>
|
60 |
To restore their theme settings pages which we had to remove due to the Customize-based settings enforcement.<br>
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
</div>
|
64 |
</div>
|
65 |
|
8 |
Navigate <a href="themes.php?page=<?php echo $this->current_theme['slug'] ?>-page"><strong>here</strong></a> to configure <?php echo ucwords($this->current_theme['slug']) ?>.
|
9 |
</p></div>
|
10 |
<?php elseif ($this->status == 4): ?>
|
11 |
+
<div class="updated"><p>Current active (or parent) theme is: <strong><?php echo ucwords($this->current_theme['slug']); ?></strong> and you are running WordPress 4.4 or newer.
|
12 |
The plugin is <strong style="color: #008000;">active</strong> in compatibility mode.<br>
|
13 |
<br>
|
14 |
Navigate <a href="themes.php?page=<?php echo $this->current_theme['slug'] ?>-page"><strong>here</strong></a> to configure <?php echo ucwords($this->current_theme['slug']) ?>.
|
39 |
<?php endswitch; ?>
|
40 |
</p></div>
|
41 |
<?php endif; ?>
|
42 |
+
<?php if ($this->renamed_theme) :?>
|
43 |
+
<div class="error">
|
44 |
+
<p>The plugin has detected that you have renamed the theme folder - this will limit your ability to update the theme.<br>
|
45 |
+
If you need to customize the theme code, we strongly recommend creating a <a href="http://www.cryoutcreations.eu/wordpress-themes/wordpress-tutorials/wordpress-child-themes" target="_blank">child theme</a>.</p>
|
46 |
+
</div>
|
47 |
+
<?php endif; ?>
|
48 |
|
49 |
<div id="poststuff">
|
50 |
<div id="post-body" class="metabox-holder columns-2">
|
64 |
<li><a href="http://wordpress.org/themes/tempera" target="_blank">Tempera</a> version 1.4 and newer</li>
|
65 |
</ul>
|
66 |
To restore their theme settings pages which we had to remove due to the Customize-based settings enforcement.<br>
|
67 |
+
</p>
|
68 |
+
<hr>
|
69 |
+
<p>
|
70 |
+
Additionally, the plugin will restore the settings page to working condition on WordPress 4.4-RC1 and newer with:
|
71 |
+
<ul><li><u>Tempera</u> versions 0.9 - 1.3.3</li>
|
72 |
+
<li><u>Parabola</u> versions 0.9 - 1.5.1</li>
|
73 |
+
<li><a href="http://wordpress.org/themes/mantra" target="_blank">Mantra</a> versions 2.0 - 2.4.1.1</li>
|
74 |
+
</ul>
|
75 |
+
</p>
|
76 |
+
<p>If you are using a different theme or a theme version not listed here this plugin will not activate.</p>
|
77 |
</div>
|
78 |
</div>
|
79 |
|
inc/tempera.php
CHANGED
@@ -4,7 +4,6 @@ if (function_exists('tempera_init_fn')):
|
|
4 |
endif;
|
5 |
|
6 |
function tempera_theme_settings_restore($class='') {
|
7 |
-
global $wp_version;
|
8 |
global $cryout_theme_settings;
|
9 |
?>
|
10 |
<form name="tempera_form" id="tempera_form" action="options.php" method="post" enctype="multipart/form-data">
|
4 |
endif;
|
5 |
|
6 |
function tempera_theme_settings_restore($class='') {
|
|
|
7 |
global $cryout_theme_settings;
|
8 |
?>
|
9 |
<form name="tempera_form" id="tempera_form" action="options.php" method="post" enctype="multipart/form-data">
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: cryout-creations
|
|
3 |
Donate link: http://www.cryoutcreations.eu/donate/
|
4 |
Tags: theme, admin
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 4.4
|
7 |
-
Stable tag: 0.5.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
|
@@ -12,34 +12,50 @@ This plugin is designed to inter-operate with our Mantra, Parabola, Tempera, Nir
|
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
-
This plugin is designed to inter-operate with our [
|
16 |
|
17 |
-
Additionally, it returns the themes' settings pages to working condition in
|
18 |
|
19 |
= Compatibility =
|
20 |
The plugin is meant to be used with the following theme releases:
|
21 |
|
22 |
-
* Parabola version 1.6 and newer
|
23 |
-
* Tempera version 1.4 and newer
|
24 |
* Nirvana version 1.2 and newer
|
|
|
|
|
25 |
|
26 |
-
On
|
27 |
|
28 |
-
* Parabola versions 0.9 - 1.5.1
|
29 |
* Tempera versions 0.9 - 1.3.3
|
|
|
30 |
* Mantra versions 2.0 - 2.4.1.1
|
31 |
|
32 |
-
You do not need this plugin if you do not use
|
33 |
|
34 |
== Installation ==
|
35 |
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
1. Upload `cryout-theme-settings` folder to the `/wp-content/plugins/` directory
|
38 |
2. Activate the plugin through the 'Plugins' menu in WordPress
|
39 |
-
3. Navigate to Appearance >
|
40 |
|
41 |
== Changelog ==
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
= 0.5.3 =
|
44 |
* Added support for Tempera 1.4
|
45 |
* Fixed typo causing error in compatibility code
|
@@ -52,4 +68,4 @@ You do not need this plugin if you do not use one of the listed themes and do no
|
|
52 |
* Clarified plugin information
|
53 |
|
54 |
= 0.5 =
|
55 |
-
* Initial release. Currently
|
3 |
Donate link: http://www.cryoutcreations.eu/donate/
|
4 |
Tags: theme, admin
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 4.4
|
7 |
+
Stable tag: 0.5.5
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
+
This plugin is designed to inter-operate with our [Nirvana](https://wordpress.org/themes/nirvana/), [Tempera](https://wordpress.org/themes/tempera/), [Parabola](https://wordpress.org/themes/parabola/) themes and restore their advanced settings pages which we had to remove due to the Customize-based settings enforcement.
|
16 |
|
17 |
+
Additionally, it returns the themes' settings pages to working condition in Tempera, Parabola and Mantra on WordPress 4.4-RC1 and newer.
|
18 |
|
19 |
= Compatibility =
|
20 |
The plugin is meant to be used with the following theme releases:
|
21 |
|
|
|
|
|
22 |
* Nirvana version 1.2 and newer
|
23 |
+
* Tempera version 1.4 and newer
|
24 |
+
* Parabola version 1.6 and newer
|
25 |
|
26 |
+
On WordPress 4.4-RC1 or newer it will restore the settings pages to working condition in:
|
27 |
|
|
|
28 |
* Tempera versions 0.9 - 1.3.3
|
29 |
+
* Parabola versions 0.9 - 1.5.1
|
30 |
* Mantra versions 2.0 - 2.4.1.1
|
31 |
|
32 |
+
You do not need this plugin if you use do not use any of the listed themes.
|
33 |
|
34 |
== Installation ==
|
35 |
|
36 |
+
= Automatic installation =
|
37 |
+
|
38 |
+
0. Have one of our supported themes activated with a non-working or disabled settings page.
|
39 |
+
1. Navigate to Plugins in your dashboard and click the Add New button.
|
40 |
+
2. Type in "Cryout Theme Settings" in the search box on the right and press Enter, then click the Install button next to the plugin title.
|
41 |
+
3. After installation Activate the plugin, then navigate to Appearance > [Theme] Settings to access the restored theme settings page.
|
42 |
+
|
43 |
+
= Manual installation =
|
44 |
+
|
45 |
+
0. Have one of our supported themes activated with a non-working or disabled settings page.
|
46 |
1. Upload `cryout-theme-settings` folder to the `/wp-content/plugins/` directory
|
47 |
2. Activate the plugin through the 'Plugins' menu in WordPress
|
48 |
+
3. Navigate to Appearance > [Theme] Settings to access the restored theme settings page.
|
49 |
|
50 |
== Changelog ==
|
51 |
|
52 |
+
= 0.5.5 =
|
53 |
+
* Added support for Parabola 1.6
|
54 |
+
* Added detection of supported themes when the theme folder is renamed
|
55 |
+
|
56 |
+
= 0.5.4 =
|
57 |
+
* Fixed compatibility support for Mantra
|
58 |
+
|
59 |
= 0.5.3 =
|
60 |
* Added support for Tempera 1.4
|
61 |
* Fixed typo causing error in compatibility code
|
68 |
* Clarified plugin information
|
69 |
|
70 |
= 0.5 =
|
71 |
+
* Initial release. Currently Nirvana 1.2 implements support for this plugin.
|