Cryout Serious Theme Settings - Version 0.5

Version Description

  • Initial release. Currently only Nirvana implements support for this plugin.
Download this release

Release Info

Developer Cryout Creations
Plugin Icon wp plugin Cryout Serious Theme Settings
Version 0.5
Comparing to
See all releases

Version 0.5

cryout-theme-settings.php ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
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
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
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();
27
+
28
+ public function __construct(){
29
+ add_action( 'init', array( $this, 'register' ) );
30
+ } // __construct()
31
+
32
+ public function register(){
33
+
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__);
48
+ add_filter( 'plugin_action_links_'.$cryout_theme_settings_slug, array( $this, 'settings_link' ) );
49
+ add_action( 'admin_menu', array( $this, 'settings_menu' ) );
50
+
51
+ } // register()
52
+
53
+ function supported_theme(){
54
+ $current_theme_slug = strtolower( wp_get_theme()->Template );
55
+ $current_theme_version = wp_get_theme()->Version;
56
+
57
+ $this->current_theme = array(
58
+ 'slug' => $current_theme_slug,
59
+ 'version' => $current_theme_version,
60
+ );
61
+
62
+ if (in_array( $current_theme_slug, array_keys( $this->supported_themes) )) {
63
+ // supported theme, check version
64
+ if ( version_compare( $current_theme_version, $this->supported_themes[$current_theme_slug] ) >=0 ):
65
+ // supported version
66
+ $this->status = 1;
67
+ return 1;
68
+ else:
69
+ // unsupported version
70
+ $this->status = 2;
71
+ return 0;
72
+ endif;
73
+ } else {
74
+ // unsupported theme
75
+ $this->status = 3;
76
+ return 0;
77
+ };
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__ ) );
84
+ wp_enqueue_style( 'cryout-theme-settings' );
85
+ } // enqueue_styles()
86
+
87
+ // register plugin settings
88
+ public function register_settings() {
89
+ register_setting( 'cryout_theme_settings_settingsgroup', array( $this, 'settings' ) );
90
+ } // register_settings() */
91
+
92
+ // register settings page to dashboard menu
93
+ public function settings_menu() {
94
+ add_submenu_page('themes.php', $this->title, $this->title, 'manage_options', $this->slug, array( $this, 'settings_page' ) );
95
+ }
96
+
97
+ // add settings link on plugin page
98
+ public function settings_link($links) {
99
+ $settings_link = '<a href="themes.php?page=' . $this->slug . '">' . __( 'Settings', 'cryout-theme-settings' ) . '</a>';
100
+ array_unshift($links, $settings_link);
101
+ return $links;
102
+ }
103
+
104
+ public function settings_page() {
105
+ require_once( plugin_dir_path( __FILE__ ) . 'inc/settings.php' );
106
+ }
107
+
108
+ /* for future use
109
+ function get_settings() {
110
+
111
+ $setting_defaults = array(
112
+ 'id' => 'value',
113
+ );
114
+
115
+ $options = get_option('cryout_theme_settings_options');
116
+ $options = array_merge($setting_defaults,(array)$options);
117
+
118
+ return $options;
119
+ } // get_settings()
120
+ */
121
+
122
+
123
+ } // class Cryout_Theme_Settings
124
+
125
+
126
+ /* * * * get things going * * * */
127
+ $cryout_theme_settings = new Cryout_Theme_Settings;
128
+
129
+ // EOF
inc/nirvana.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ 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 $cryout_theme_settings; ?>
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>
13
+ <div id="submitDiv">
14
+ <br>
15
+ <input class="button" name="nirvana_settings[nirvana_submit]" type="submit" id="nirvana_sumbit" style="float:right;" value="<?php _e('Save Changes','nirvana'); ?>" />
16
+ <input class="button" name="nirvana_settings[nirvana_defaults]" id="nirvana_defaults" type="submit" style="float:left;" value="<?php _e('Reset to Defaults','nirvana'); ?>" />
17
+ </div>
18
+ </form>
19
+ <?php
20
+ } // nirvana_theme_settings_buttons()
21
+
inc/parabola.php ADDED
File without changes
inc/settings.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <h2><?php _e('Cryout Serious Theme Settings Status', 'cryout-theme-settings') ?></h2>
3
+
4
+ <?php if ($this->status == 1): ?>
5
+ <div class="updated"><p>Current active (or parent) theme is: <strong><?php echo ucwords($this->current_theme['slug']); ?></strong>.
6
+ The plugin is <strong style="color: #008000;">active</strong>.<br>
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
13
+ switch ($this->status):
14
+ case 3:
15
+ // unsupported theme ?>
16
+ Current active (or parent) theme is: <strong><?php echo ucwords($this->current_theme['slug']); ?></strong>.<br><br>
17
+ This plugin is designed to work only with the supported themes. <br>
18
+ The plugin is <strong style="color: #800000;">INACTIVE</strong>. <?php
19
+ break;
20
+ case 2:
21
+ // unsupported version ?>
22
+ Current active (or parent) theme is: <strong><?php echo ucwords($this->current_theme['slug']) ?></strong>, however the plugin is only compatible with version <b><?php echo $this->supported_themes[$this->current_theme['slug']] ?></b> or newer of <em><?php echo ucwords($this->current_theme['slug']) ?></em>.<br><br>
23
+ You are running <em><?php echo ucwords($this->current_theme['slug']) ?> v<?php echo $this->current_theme['version'] ?></em>. Please update the theme or disable this plugin.</br>
24
+ The plugin is <strong style="color: #800000;">INACTIVE</strong>. <?php
25
+ break;
26
+ case 0:
27
+ default:
28
+ // inactive/undefined ?>
29
+ Current active (or parent) theme is: <strong><?php echo ucwords($this->current_theme['slug']); ?></strong>.<br>
30
+ This plugin is designed to work only with the supported themes. <br>
31
+ The plugin is <strong style="color: #800000;">INACTIVE</strong>. <?php
32
+ break; ?>
33
+ <?php endswitch; ?>
34
+ </p></div>
35
+ <?php endif; ?>
36
+
37
+ <div id="poststuff">
38
+ <div id="post-body" class="metabox-holder columns-2">
39
+
40
+ <div id="post-body-content">
41
+
42
+ <div class="postbox">
43
+
44
+ <div class="handlediv" title="Click to toggle"><br></div>
45
+ <h3 class="hndle"><span>About</span></h3>
46
+
47
+ <div class="inside">
48
+ <p>
49
+ This plugin is designed to inter-operate with our supported themes:
50
+ <ul><li><a href="http://wordpress.org/themes/nirvana" target="_blank">Nirvana</a> version 1.2 and newer</li>
51
+ <li><a href="http://wordpress.org/themes/parabola" target="_blank">Parabola</a> version 1.6 and newer</li>
52
+ <li><a href="http://wordpress.org/themes/tempera" target="_blank">Tempera</a> version 1.4 and newer</li>
53
+ </ul>
54
+ To restore their theme settings pages which we had to remove due to the Customize-based settings enforcement.
55
+ </p>
56
+ </div>
57
+ </div>
58
+
59
+ </div> <!-- post-body-content-->
60
+
61
+ <div class="postbox-container" id="postbox-container-1">
62
+
63
+ <div class="meta-box-sortables">
64
+
65
+ <div class="postbox">
66
+ <div class="handlediv"><br></div>
67
+ <h3 style="text-align: center;" class="hndle">
68
+ <span><strong>Cryout Serious Theme Settings</strong></span>
69
+ </h3>
70
+
71
+ <div class="inside">
72
+ <div style="text-align: center; margin: auto">
73
+ <strong>version: <?php echo $this->version ?></strong><br>
74
+ by Cryout Creations<br>
75
+ <a target="_blank" href="http://www.cryoutcreations.eu/">www.cryoutcreations.eu</a>
76
+ </div>
77
+ </div>
78
+ </div>
79
+
80
+ <div class="postbox">
81
+ <div class="handlediv"><br></div>
82
+ <h3 style="text-align: center;" class="hndle">
83
+ <span>Support</span>
84
+ </h3><div class="inside">
85
+ <div style="text-align: center; margin: auto">
86
+ For support questions,<br>
87
+ please use <a target="_blank" href="http://www.cryoutcreations.eu/forum">our forum</a>.
88
+ </div>
89
+ </div>
90
+ </div>
91
+ </div>
92
+ </div> <!-- postbox-container -->
93
+
94
+ </div> <!-- post-body -->
95
+ <br class="clear">
96
+ </div> <!-- poststuff -->
97
+
98
+ </div><!--end wrap-->
inc/tempera.php ADDED
File without changes
readme.txt ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Plugin Name ===
2
+ 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.3.1
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
+
20
+ * Parabola version 1.6 and newer
21
+ * Tempera version 1.4 and newer
22
+ * Nirvana version 1.2 and newer
23
+
24
+ == Installation ==
25
+
26
+ 0. Have one of our supported themes activated.
27
+ 1. Upload `cryout-theme-settings` folder to the `/wp-content/plugins/` directory
28
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
29
+ 3. Navigate to Appearance > "Theme" Settings to access the restored theme settings page.
30
+
31
+ == Changelog ==
32
+
33
+ = 0.5 =
34
+ * Initial release. Currently only Nirvana implements support for this plugin.