Version Description
- Added themes compatibility fix for WordPress 4.4-RC1 and newer
Download this release
Release Info
Developer | Cryout Creations |
Plugin | Cryout Serious Theme Settings |
Version | 0.5.2 |
Comparing to | |
See all releases |
Code changes from version 0.5.1 to 0.5.2
- code.js +6 -0
- cryout-theme-settings.php +35 -8
- inc/nirvana.php +5 -3
- inc/settings.php +6 -0
- readme.txt +14 -3
code.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
jQuery(document).ready(function(){
|
3 |
+
jQuery("#main-options #accordion h2").each(function(){
|
4 |
+
jQuery(this).replaceWith("<h3>" + jQuery(this).html() + "</h3>");
|
5 |
+
});
|
6 |
+
})
|
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,16 +11,21 @@
|
|
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
|
18 |
|
19 |
private $supported_themes = array(
|
20 |
'nirvana' => '1.2',
|
21 |
'tempera' => '1.4',
|
22 |
'parabola' => '1.6',
|
23 |
);
|
|
|
|
|
|
|
|
|
|
|
24 |
private $slug = 'cryout-theme-settings';
|
25 |
private $title = '';
|
26 |
public $current_theme = array();
|
@@ -34,14 +39,25 @@ class Cryout_Theme_Settings {
|
|
34 |
$this->title = __( 'Cryout Serious Theme Settings', 'cryout-theme-settings' );
|
35 |
if ( $this->supported_theme() ):
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
//add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ) ); // not currently used
|
38 |
//add_action( 'admin_init', array( $this, 'register_settings' ) ); // not currently used
|
39 |
|
40 |
-
//$this->slug = 'cryout-' . strtolower($this->current_theme['slug']) . '-settings';
|
41 |
-
//$this->title = ucwords($this->current_theme['slug']) . ' ' . __( 'Settings', 'cryout-theme-settings' );
|
42 |
-
|
43 |
-
include_once( plugin_dir_path( __FILE__ ) . 'inc/' . strtolower($this->current_theme['slug']) . '.php' );
|
44 |
-
|
45 |
endif;
|
46 |
|
47 |
$cryout_theme_settings_slug = plugin_basename(__FILE__);
|
@@ -51,6 +67,8 @@ class Cryout_Theme_Settings {
|
|
51 |
} // register()
|
52 |
|
53 |
function supported_theme(){
|
|
|
|
|
54 |
$current_theme_slug = strtolower( wp_get_theme()->Template );
|
55 |
$current_theme_version = wp_get_theme($current_theme_slug)->Version;
|
56 |
|
@@ -65,6 +83,11 @@ class Cryout_Theme_Settings {
|
|
65 |
// supported version
|
66 |
$this->status = 1;
|
67 |
return 1;
|
|
|
|
|
|
|
|
|
|
|
68 |
else:
|
69 |
// unsupported version
|
70 |
$this->status = 2;
|
@@ -78,6 +101,10 @@ class Cryout_Theme_Settings {
|
|
78 |
|
79 |
} // supported_theme()
|
80 |
|
|
|
|
|
|
|
|
|
81 |
/* currently not used
|
82 |
public function enqueue_styles() {
|
83 |
wp_register_style( 'cryout-theme-settings', plugins_url( 'style.css', __FILE__ ) );
|
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.2
|
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.2";
|
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 |
);
|
24 |
+
private $compatibility_themes = array(
|
25 |
+
'tempera' => '0.9',
|
26 |
+
'parabola' => '0.9',
|
27 |
+
'mantra' => '2.0',
|
28 |
+
);
|
29 |
private $slug = 'cryout-theme-settings';
|
30 |
private $title = '';
|
31 |
public $current_theme = array();
|
39 |
$this->title = __( 'Cryout Serious Theme Settings', 'cryout-theme-settings' );
|
40 |
if ( $this->supported_theme() ):
|
41 |
|
42 |
+
switch ($this->status):
|
43 |
+
case 1: // restore theme settings
|
44 |
+
|
45 |
+
include_once( plugin_dir_path( __FILE__ ) . 'inc/' . strtolower($this->current_theme['slug']) . '.php' );
|
46 |
+
|
47 |
+
break;
|
48 |
+
case 4: // repair wrong headings
|
49 |
+
|
50 |
+
add_action( 'admin_init', array( $this, 'enqueue_script' ) );
|
51 |
+
|
52 |
+
break;
|
53 |
+
|
54 |
+
default:
|
55 |
+
break;
|
56 |
+
endswitch;
|
57 |
+
|
58 |
//add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ) ); // not currently used
|
59 |
//add_action( 'admin_init', array( $this, 'register_settings' ) ); // not currently used
|
60 |
|
|
|
|
|
|
|
|
|
|
|
61 |
endif;
|
62 |
|
63 |
$cryout_theme_settings_slug = plugin_basename(__FILE__);
|
67 |
} // register()
|
68 |
|
69 |
function supported_theme(){
|
70 |
+
global $wp_version;
|
71 |
+
|
72 |
$current_theme_slug = strtolower( wp_get_theme()->Template );
|
73 |
$current_theme_version = wp_get_theme($current_theme_slug)->Version;
|
74 |
|
83 |
// supported version
|
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.4') >= 0) ):
|
88 |
+
// compatibility mode
|
89 |
+
$this->status = 4;
|
90 |
+
return 4;
|
91 |
else:
|
92 |
// unsupported version
|
93 |
$this->status = 2;
|
101 |
|
102 |
} // supported_theme()
|
103 |
|
104 |
+
public function enqueue_script() {
|
105 |
+
wp_enqueue_script( 'cryout-theme-settings-code', plugins_url( 'code.js', __FILE__ ) );
|
106 |
+
} // enqueue_script()
|
107 |
+
|
108 |
/* currently not used
|
109 |
public function enqueue_styles() {
|
110 |
wp_register_style( 'cryout-theme-settings', plugins_url( 'style.css', __FILE__ ) );
|
inc/nirvana.php
CHANGED
@@ -3,10 +3,12 @@ if (function_exists('nirvana_init_fn')):
|
|
3 |
add_action('admin_init', 'nirvana_init_fn');
|
4 |
endif;
|
5 |
|
6 |
-
function nirvana_theme_settings_restore() {
|
7 |
-
global $
|
|
|
|
|
8 |
<form name="nirvana_form" id="nirvana_form" action="options.php" method="post" enctype="multipart/form-data">
|
9 |
-
<div id="accordion">
|
10 |
<?php settings_fields('nirvana_settings'); ?>
|
11 |
<?php do_settings_sections($cryout_theme_settings->current_theme['slug'] . '-page'); ?>
|
12 |
</div>
|
3 |
add_action('admin_init', 'nirvana_init_fn');
|
4 |
endif;
|
5 |
|
6 |
+
function nirvana_theme_settings_restore($class='') {
|
7 |
+
global $wp_version;
|
8 |
+
global $cryout_theme_settings;
|
9 |
+
?>
|
10 |
<form name="nirvana_form" id="nirvana_form" action="options.php" method="post" enctype="multipart/form-data">
|
11 |
+
<div id="accordion" class="<?php echo $class; ?>">
|
12 |
<?php settings_fields('nirvana_settings'); ?>
|
13 |
<?php do_settings_sections($cryout_theme_settings->current_theme['slug'] . '-page'); ?>
|
14 |
</div>
|
inc/settings.php
CHANGED
@@ -7,6 +7,12 @@
|
|
7 |
<br>
|
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 else: ?>
|
11 |
<div class="error"><p>
|
12 |
<?php
|
7 |
<br>
|
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']) ?>.
|
15 |
+
</p></div>
|
16 |
<?php else: ?>
|
17 |
<div class="error"><p>
|
18 |
<?php
|
readme.txt
CHANGED
@@ -3,23 +3,31 @@ 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.
|
7 |
-
Stable tag: 0.5.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
|
11 |
-
This plugin is designed to inter-operate with our Parabola, Tempera, Nirvana themes and restore their advanced settings pages.
|
|
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
This plugin is designed to inter-operate with our [Parabola](https://wordpress.org/themes/parabola/), [Tempera](https://wordpress.org/themes/tempera/), [Nirvana](https://wordpress.org/themes/nirvana/) themes and restore their advanced settings pages which we had to remove due to the Customize-based settings enforcement.
|
16 |
|
|
|
|
|
17 |
= Compatibility =
|
18 |
The plugin is meant to be used with the following theme releases:
|
19 |
* Parabola version 1.6 and newer
|
20 |
* Tempera version 1.4 and newer
|
21 |
* Nirvana version 1.2 and newer
|
22 |
|
|
|
|
|
|
|
|
|
|
|
23 |
== Installation ==
|
24 |
|
25 |
0. Have one of our supported themes activated.
|
@@ -29,6 +37,9 @@ The plugin is meant to be used with the following theme releases:
|
|
29 |
|
30 |
== Changelog ==
|
31 |
|
|
|
|
|
|
|
32 |
= 0.5.1 =
|
33 |
* Fixed detection of parent theme name and version when using a child theme
|
34 |
* Clarified plugin information
|
3 |
Donate link: http://www.cryoutcreations.eu/donate/
|
4 |
Tags: theme, admin
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 4.4-RC1
|
7 |
+
Stable tag: 0.5.2
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
|
11 |
+
This plugin is designed to inter-operate with our Mantra, Parabola, Tempera, Nirvana themes and restore their advanced settings pages.
|
12 |
+
It will also return the themes' settings pages to working condition after a problematic functionality change in Wordpress 4.4-RC1 and newer.
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
This plugin is designed to inter-operate with our [Parabola](https://wordpress.org/themes/parabola/), [Tempera](https://wordpress.org/themes/tempera/), [Nirvana](https://wordpress.org/themes/nirvana/) themes and restore their advanced settings pages which we had to remove due to the Customize-based settings enforcement.
|
17 |
|
18 |
+
Additionally, it returns the themes' settings pages to working condition in Mantra, Parabola and Tempera on Wordpress 4.4-RC1 and newer.
|
19 |
+
|
20 |
= Compatibility =
|
21 |
The plugin is meant to be used with the following theme releases:
|
22 |
* Parabola version 1.6 and newer
|
23 |
* Tempera version 1.4 and newer
|
24 |
* Nirvana version 1.2 and newer
|
25 |
|
26 |
+
On Wordpress 4.4-RC1 or newer it will restore the settings pages to working condition in:
|
27 |
+
* Parabola versions up to 1.5.1
|
28 |
+
* Tempera versions up to 1.3.3
|
29 |
+
* Mantra versions between 2.0 and 2.4.1.1
|
30 |
+
|
31 |
== Installation ==
|
32 |
|
33 |
0. Have one of our supported themes activated.
|
37 |
|
38 |
== Changelog ==
|
39 |
|
40 |
+
= 0.5.2 =
|
41 |
+
* Added themes compatibility fix for WordPress 4.4-RC1 and newer
|
42 |
+
|
43 |
= 0.5.1 =
|
44 |
* Fixed detection of parent theme name and version when using a child theme
|
45 |
* Clarified plugin information
|