Version Description
- Fixed incorrect status for Nirvana versions before 1.2
Download this release
Release Info
Developer | Cryout Creations |
Plugin | Cryout Serious Theme Settings |
Version | 0.5.7 |
Comparing to | |
See all releases |
Code changes from version 0.5.5 to 0.5.7
- cryout-theme-settings.php +20 -28
- inc/mantra.php +21 -0
- inc/settings.php +9 -2
- readme.txt +15 -8
cryout-theme-settings.php
CHANGED
@@ -1,32 +1,35 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Cryout Serious Theme Settings
|
4 |
-
Plugin URI:
|
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:
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl.html
|
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
|
18 |
|
19 |
private $supported_themes = array(
|
20 |
'nirvana' => '1.2',
|
21 |
'tempera' => '1.4',
|
22 |
'parabola' => '1.6',
|
23 |
-
'mantra' => '
|
24 |
);
|
25 |
private $compatibility_themes = array(
|
26 |
'tempera' => '0.9',
|
27 |
'parabola' => '0.9',
|
28 |
'mantra' => '2.0',
|
29 |
);
|
|
|
|
|
|
|
30 |
private $slug = 'cryout-theme-settings';
|
31 |
private $title = '';
|
32 |
public $current_theme = array();
|
@@ -78,11 +81,6 @@ class Cryout_Theme_Settings {
|
|
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';
|
@@ -103,6 +101,11 @@ class Cryout_Theme_Settings {
|
|
103 |
$current_theme_slug = 'nirvana';
|
104 |
$current_theme_version = NIRVANA_VERSION;
|
105 |
}
|
|
|
|
|
|
|
|
|
|
|
106 |
} // end additional checks
|
107 |
|
108 |
$this->current_theme = array(
|
@@ -112,15 +115,19 @@ class Cryout_Theme_Settings {
|
|
112 |
|
113 |
if (in_array( $current_theme_slug, array_keys( $this->supported_themes) )) {
|
114 |
// supported theme, check version
|
115 |
-
if ( version_compare( $current_theme_version, $this->supported_themes[$current_theme_slug]
|
116 |
// supported version
|
117 |
$this->status = 1;
|
118 |
return 1;
|
119 |
-
elseif ( (version_compare( $current_theme_version, $this->compatibility_themes[$current_theme_slug]
|
120 |
(version_compare($wp_version, '4.3.9999') >= 0) ):
|
121 |
// compatibility mode
|
122 |
$this->status = 4;
|
123 |
return 4;
|
|
|
|
|
|
|
|
|
124 |
else:
|
125 |
// unsupported version
|
126 |
$this->status = 2;
|
@@ -165,21 +172,6 @@ class Cryout_Theme_Settings {
|
|
165 |
public function settings_page() {
|
166 |
require_once( plugin_dir_path( __FILE__ ) . 'inc/settings.php' );
|
167 |
}
|
168 |
-
|
169 |
-
/* for future use
|
170 |
-
function get_settings() {
|
171 |
-
|
172 |
-
$setting_defaults = array(
|
173 |
-
'id' => 'value',
|
174 |
-
);
|
175 |
-
|
176 |
-
$options = get_option('cryout_theme_settings_options');
|
177 |
-
$options = array_merge($setting_defaults,(array)$options);
|
178 |
-
|
179 |
-
return $options;
|
180 |
-
} // get_settings()
|
181 |
-
*/
|
182 |
-
|
183 |
|
184 |
} // class Cryout_Theme_Settings
|
185 |
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Cryout Serious Theme Settings
|
4 |
+
Plugin URI: https://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
|
7 |
Author: Cryout Creations
|
8 |
+
Author URI: https://www.cryoutcreations.eu
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl.html
|
11 |
*/
|
12 |
|
13 |
class Cryout_Theme_Settings {
|
14 |
+
public $version = "0.5.7";
|
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, 5 = theme requires update
|
18 |
|
19 |
private $supported_themes = array(
|
20 |
'nirvana' => '1.2',
|
21 |
'tempera' => '1.4',
|
22 |
'parabola' => '1.6',
|
23 |
+
'mantra' => '2.5',
|
24 |
);
|
25 |
private $compatibility_themes = array(
|
26 |
'tempera' => '0.9',
|
27 |
'parabola' => '0.9',
|
28 |
'mantra' => '2.0',
|
29 |
);
|
30 |
+
private $requires_update = array(
|
31 |
+
'nirvana' => '0.9',
|
32 |
+
);
|
33 |
private $slug = 'cryout-theme-settings';
|
34 |
private $title = '';
|
35 |
public $current_theme = array();
|
81 |
// theme slug does not match supported themes
|
82 |
// perform additional checks for theme constants
|
83 |
|
|
|
|
|
|
|
|
|
|
|
84 |
if (defined('MANTRA_VERSION')) {
|
85 |
if ($current_theme_slug != 'mantra') $this->renamed_theme = true;
|
86 |
$current_theme_slug = 'mantra';
|
101 |
$current_theme_slug = 'nirvana';
|
102 |
$current_theme_version = NIRVANA_VERSION;
|
103 |
}
|
104 |
+
if (defined('_CRYOUT_THEME_NAME')) {
|
105 |
+
if ($current_theme_slug != _CRYOUT_THEME_NAME) $this->renamed_theme = true;
|
106 |
+
$current_theme_slug = _CRYOUT_THEME_NAME;
|
107 |
+
if (defined('_CRYOUT_THEME_VERSION')) $current_theme_version = _CRYOUT_THEME_VERSION;
|
108 |
+
}
|
109 |
} // end additional checks
|
110 |
|
111 |
$this->current_theme = array(
|
115 |
|
116 |
if (in_array( $current_theme_slug, array_keys( $this->supported_themes) )) {
|
117 |
// supported theme, check version
|
118 |
+
if ( version_compare( $current_theme_version, $this->supported_themes[$current_theme_slug], '>=' ) ):
|
119 |
// supported version
|
120 |
$this->status = 1;
|
121 |
return 1;
|
122 |
+
elseif ( isset($this->compatibility_themes[$current_theme_slug]) && (version_compare( $current_theme_version, $this->compatibility_themes[$current_theme_slug], '>=' ) ) &&
|
123 |
(version_compare($wp_version, '4.3.9999') >= 0) ):
|
124 |
// compatibility mode
|
125 |
$this->status = 4;
|
126 |
return 4;
|
127 |
+
elseif ( isset($this->requires_update[$current_theme_slug])):
|
128 |
+
// theme requires update to be supported
|
129 |
+
$this->status = 5;
|
130 |
+
return 0;
|
131 |
else:
|
132 |
// unsupported version
|
133 |
$this->status = 2;
|
172 |
public function settings_page() {
|
173 |
require_once( plugin_dir_path( __FILE__ ) . 'inc/settings.php' );
|
174 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
} // class Cryout_Theme_Settings
|
177 |
|
inc/mantra.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (function_exists('mantra_init_fn')):
|
3 |
+
add_action('admin_init', 'mantra_init_fn');
|
4 |
+
endif;
|
5 |
+
|
6 |
+
function mantra_theme_settings_restore($class='') {
|
7 |
+
global $cryout_theme_settings;
|
8 |
+
?>
|
9 |
+
<form name="mantra_form" action="options.php" method="post" enctype="multipart/form-data">
|
10 |
+
<div id="accordion">
|
11 |
+
<?php settings_fields('ma_options'); ?>
|
12 |
+
<?php do_settings_sections('mantra-page'); ?>
|
13 |
+
</div>
|
14 |
+
<div id="submitDiv">
|
15 |
+
<br>
|
16 |
+
<input class="button" name="ma_options[mantra_submit]" type="submit" style="float:right;" value="<?php _e('Save Changes','mantra'); ?>" />
|
17 |
+
<input class="button" name="ma_options[mantra_defaults]" id="mantra_defaults" type="submit" style="float:left;" value="<?php _e('Reset to Defaults','mantra'); ?>" />
|
18 |
+
</div>
|
19 |
+
</form>
|
20 |
+
<?php
|
21 |
+
} // mantra_theme_settings_buttons()
|
inc/settings.php
CHANGED
@@ -17,6 +17,12 @@
|
|
17 |
<div class="error"><p>
|
18 |
<?php
|
19 |
switch ($this->status):
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
case 3:
|
21 |
// unsupported theme ?>
|
22 |
Current active (or parent) theme is: <strong><?php echo ucwords($this->current_theme['slug']); ?></strong>.<br>
|
@@ -53,13 +59,14 @@
|
|
53 |
|
54 |
<div class="postbox">
|
55 |
|
56 |
-
<div class="handlediv"
|
57 |
<h3 class="hndle"><span>About</span></h3>
|
58 |
|
59 |
<div class="inside">
|
60 |
<p>
|
61 |
This plugin is designed to inter-operate with our supported themes:
|
62 |
-
<ul><li><a href="http://wordpress.org/themes/
|
|
|
63 |
<li><a href="http://wordpress.org/themes/parabola" target="_blank">Parabola</a> version 1.6 and newer</li>
|
64 |
<li><a href="http://wordpress.org/themes/tempera" target="_blank">Tempera</a> version 1.4 and newer</li>
|
65 |
</ul>
|
17 |
<div class="error"><p>
|
18 |
<?php
|
19 |
switch ($this->status):
|
20 |
+
case 5:
|
21 |
+
// theme requires update ?>
|
22 |
+
Current active (or parent) theme is: <strong><?php echo ucwords($this->current_theme['slug']); ?></strong>.<br>
|
23 |
+
This plugin cannot work with this version of the theme. Please update the theme first. <br>
|
24 |
+
The plugin is <strong style="color: #800000;">INACTIVE</strong>. <?php
|
25 |
+
break;
|
26 |
case 3:
|
27 |
// unsupported theme ?>
|
28 |
Current active (or parent) theme is: <strong><?php echo ucwords($this->current_theme['slug']); ?></strong>.<br>
|
59 |
|
60 |
<div class="postbox">
|
61 |
|
62 |
+
<div class="handlediv"><br></div>
|
63 |
<h3 class="hndle"><span>About</span></h3>
|
64 |
|
65 |
<div class="inside">
|
66 |
<p>
|
67 |
This plugin is designed to inter-operate with our supported themes:
|
68 |
+
<ul><li><a href="http://wordpress.org/themes/mantra" target="_blank">Mantra</a> version 2.5 and newer</li>
|
69 |
+
<li><a href="http://wordpress.org/themes/nirvana" target="_blank">Nirvana</a> version 1.2 and newer</li>
|
70 |
<li><a href="http://wordpress.org/themes/parabola" target="_blank">Parabola</a> version 1.6 and newer</li>
|
71 |
<li><a href="http://wordpress.org/themes/tempera" target="_blank">Tempera</a> version 1.4 and newer</li>
|
72 |
</ul>
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Plugin Name ===
|
2 |
-
Contributors: cryout-creations
|
3 |
-
Donate link:
|
4 |
Tags: theme, admin
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 0.5.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
|
@@ -12,18 +12,19 @@ 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 [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
|
16 |
|
17 |
-
Additionally, it
|
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 |
-
|
27 |
|
28 |
* Tempera versions 0.9 - 1.3.3
|
29 |
* Parabola versions 0.9 - 1.5.1
|
@@ -49,6 +50,12 @@ You do not need this plugin if you use do not use any of the listed themes.
|
|
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
|
1 |
=== Plugin Name ===
|
2 |
+
Contributors: Cryout Creations, cryout-creations
|
3 |
+
Donate link: https://www.cryoutcreations.eu/donate/
|
4 |
Tags: theme, admin
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 4.8.0
|
7 |
+
Stable tag: 0.5.7
|
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/), [Mantra](https://wordpress.org/themes/mantra/) themes and restore their advanced settings pages which we had to remove due to the Customize-based settings transition.
|
16 |
|
17 |
+
Additionally, it fixes an incompatibility between the older version of listed themes and Wordpress 4.4 and newer.
|
18 |
|
19 |
= Compatibility =
|
20 |
+
The plugin is meant to be used with the following theme releases regardless of WordPress version:
|
21 |
|
22 |
* Nirvana version 1.2 and newer
|
23 |
* Tempera version 1.4 and newer
|
24 |
* Parabola version 1.6 and newer
|
25 |
+
* Mantra version 2.5 and newer
|
26 |
|
27 |
+
Additionally, it is needed to correct an incompatibility between WordPress 4.4 and newer and the following theme versions:
|
28 |
|
29 |
* Tempera versions 0.9 - 1.3.3
|
30 |
* Parabola versions 0.9 - 1.5.1
|
50 |
|
51 |
== Changelog ==
|
52 |
|
53 |
+
= 0.5.7 =
|
54 |
+
* Fixed incorrect status for Nirvana versions before 1.2
|
55 |
+
|
56 |
+
= 0.5.6 =
|
57 |
+
* Added support for Mantra 2.5
|
58 |
+
|
59 |
= 0.5.5 =
|
60 |
* Added support for Parabola 1.6
|
61 |
* Added detection of supported themes when the theme folder is renamed
|