Ditty News Ticker - Version 1.0.6

Version Description

  • Updated settings scripts for extensibility.
  • Minor update to metaboxer css.
Download this release

Release Info

Developer metaphorcreations
Plugin Icon 128x128 Ditty News Ticker
Version 1.0.6
Comparing to
See all releases

Code changes from version 1.0.5 to 1.0.6

ditty-news-ticker.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ditty News Ticker
4
  Plugin URI: http://dittynewsticker.com/
5
  Description: Ditty News Ticker is a multi-functional data display plugin
6
- Version: 1.0.5
7
  Author: Metaphor Creations
8
  Author URI: http://www.metaphorcreations.com
9
  License: GPL2
@@ -45,9 +45,9 @@ The icons are licensed under a Creative Commons Attribution
45
  * @since 1.0.0
46
  */
47
  if ( WP_DEBUG ) {
48
- define ( 'MTPHR_DNT_VERSION', '1.0.5-'.time() );
49
  } else {
50
- define ( 'MTPHR_DNT_VERSION', '1.0.5' );
51
  }
52
  define ( 'MTPHR_DNT_DIR', plugin_dir_path(__FILE__) );
53
  define ( 'MTPHR_DNT_URL', plugins_url().'/ditty-news-ticker' );
3
  Plugin Name: Ditty News Ticker
4
  Plugin URI: http://dittynewsticker.com/
5
  Description: Ditty News Ticker is a multi-functional data display plugin
6
+ Version: 1.0.6
7
  Author: Metaphor Creations
8
  Author URI: http://www.metaphorcreations.com
9
  License: GPL2
45
  * @since 1.0.0
46
  */
47
  if ( WP_DEBUG ) {
48
+ define ( 'MTPHR_DNT_VERSION', '1.0.6-'.time() );
49
  } else {
50
+ define ( 'MTPHR_DNT_VERSION', '1.0.6' );
51
  }
52
  define ( 'MTPHR_DNT_DIR', plugin_dir_path(__FILE__) );
53
  define ( 'MTPHR_DNT_URL', plugins_url().'/ditty-news-ticker' );
includes/functions.php CHANGED
@@ -377,6 +377,22 @@ function mtphr_dnt_modes_array() {
377
 
378
 
379
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
  add_action( 'plugins_loaded', 'mtphr_dnt_localization' );
381
  /**
382
  * Setup localization
377
 
378
 
379
 
380
+ /**
381
+ * Return an array of the current DNT settings
382
+ *
383
+ * @since 1.0.6
384
+ */
385
+ function mtphr_dnt_settings_tabs() {
386
+
387
+ $dnt_settings_array = array();
388
+ $dnt_settings_array['general'] = 'mtphr_dnt_general_settings';
389
+
390
+ return apply_filters('mtphr_dnt_settings', $dnt_settings_array);
391
+ }
392
+
393
+
394
+
395
+
396
  add_action( 'plugins_loaded', 'mtphr_dnt_localization' );
397
  /**
398
  * Setup localization
includes/metaboxer/metaboxer.css CHANGED
@@ -25,7 +25,7 @@
25
  margin-bottom: 10px;
26
  }
27
  .mtphr-dnt-metaboxer-field:last-child {
28
- margin-bottom: 20px;
29
  }
30
  .mtphr-dnt-metaboxer-field input[type="checkbox"] {
31
  margin-top: 0;
25
  margin-bottom: 10px;
26
  }
27
  .mtphr-dnt-metaboxer-field:last-child {
28
+ margin-bottom: 0;
29
  }
30
  .mtphr-dnt-metaboxer-field input[type="checkbox"] {
31
  margin-top: 0;
includes/settings.php CHANGED
@@ -33,7 +33,7 @@ add_action( 'admin_init', 'mtphr_dnt_initialize_settings' );
33
  /**
34
  * Setup the custom options for the settings page
35
  *
36
- * @since 1.0.0
37
  */
38
  function mtphr_dnt_initialize_settings() {
39
 
@@ -55,8 +55,8 @@ function mtphr_dnt_initialize_settings() {
55
  /* Register the general options */
56
  add_settings_section(
57
  'mtphr_dnt_general_settings_section', // ID used to identify this section and with which to register options
58
- __( ' ', 'ditty-news-ticker' ), // Title to be displayed on the administration page
59
- false, // Callback used to render the description of the section
60
  'mtphr_dnt_general_settings' // Page on which to add this section of options
61
  );
62
 
@@ -71,46 +71,6 @@ function mtphr_dnt_initialize_settings() {
71
 
72
  // Register the fields with WordPress
73
  register_setting( 'mtphr_dnt_general_settings', 'mtphr_dnt_general_settings' );
74
-
75
- /**
76
- * License options sections
77
- */
78
- $license_settings = array();
79
-
80
- /*
81
- $license_settings['test'] = array(
82
- 'title' => __( 'Test', 'ditty-news-ticker' ),
83
- 'type' => 'text',
84
- 'default' => 'sidebar-right'
85
- );
86
- */
87
-
88
- if( false == get_option('mtphr_dnt_license_settings') ) {
89
- add_option( 'mtphr_dnt_license_settings' );
90
- }
91
-
92
- // Register the style options
93
- add_settings_section(
94
- 'mtphr_dnt_license_settings_section', // ID used to identify this section and with which to register options
95
- __( ' ', 'ditty-news-ticker' ), // Title to be displayed on the administration page
96
- false, // Callback used to render the description of the section
97
- 'mtphr_dnt_license_settings' // Page on which to add this section of options
98
- );
99
-
100
- $license_settings = apply_filters( 'mtphr_dnt_license_settings', $license_settings );
101
-
102
- if( is_array($license_settings) ) {
103
- foreach( $license_settings as $id => $setting ) {
104
- $setting['option'] = 'mtphr_dnt_license_settings';
105
- $setting['option_id'] = $id;
106
- $setting['id'] = 'mtphr_dnt_license_settings['.$id.']';
107
- add_settings_field( $setting['id'], $setting['title'], 'mtphr_dnt_settings_callback', 'mtphr_dnt_license_settings', 'mtphr_dnt_license_settings_section', $setting);
108
- }
109
- }
110
-
111
- // Register the fields with WordPress
112
- register_setting( 'mtphr_dnt_license_settings', 'mtphr_dnt_license_settings' );
113
-
114
  }
115
 
116
 
@@ -119,7 +79,7 @@ $license_settings['test'] = array(
119
  /**
120
  * Render the theme options page
121
  *
122
- * @since 1.0.0
123
  */
124
  function mtphr_dnt_settings_display( $active_tab = null ) {
125
  ?>
@@ -130,35 +90,31 @@ function mtphr_dnt_settings_display( $active_tab = null ) {
130
  <h2><?php _e( 'Ditty News Ticker Settings', 'ditty-news-ticker' ); ?></h2>
131
  <?php settings_errors(); ?>
132
 
133
- <?php
134
- if( isset( $_GET[ 'tab' ] ) ) {
135
- $active_tab = $_GET[ 'tab' ];
136
- } else if( $active_tab == 'license_settings' ) {
137
- $active_tab = 'license_settings';
138
- } else {
139
- $active_tab = 'general_settings';
140
- }
141
  ?>
142
-
143
- <h2 class="nav-tab-wrapper">
144
- <a href="?post_type=ditty_news_ticker&page=mtphr_dnt_settings&tab=general_settings" class="nav-tab <?php echo $active_tab == 'general_settings' ? 'nav-tab-active' : ''; ?>"><?php _e( 'General', 'ditty-news-ticker' ); ?></a>
145
- <!-- <a href="?post_type=ditty_news_ticker&page=mtphr_dnt_settings&tab=license_settings" class="nav-tab <?php echo $active_tab == 'license_settings' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Extension Licenses', 'ditty-news-ticker' ); ?></a> -->
146
- </h2>
 
 
 
 
 
 
 
 
 
 
147
 
148
  <form method="post" action="options.php">
149
  <?php
150
- if( $active_tab == 'license_settings' ) {
151
-
152
- settings_fields( 'mtphr_dnt_license_settings' );
153
- do_settings_sections( 'mtphr_dnt_license_settings' );
154
-
155
- } else {
156
-
157
- settings_fields( 'mtphr_dnt_general_settings' );
158
- do_settings_sections( 'mtphr_dnt_general_settings' );
159
- }
160
-
161
- submit_button();
162
  ?>
163
  </form>
164
 
@@ -172,20 +128,14 @@ function mtphr_dnt_settings_display( $active_tab = null ) {
172
  /**
173
  * General options section callback
174
  *
175
- * @since 1.0.0
176
  */
177
  function mtphr_dnt_general_settings_callback() {
178
- echo '<p>'.__( 'Add global settings to your news tickers.', 'ditty-news-ticker' ).'</p>';
179
- echo '<p>'.__( 'Use the Custom CSS textarea to set global or individual styles to each of your tickers.', 'ditty-news-ticker' ).'</p>';
180
- }
181
-
182
- /**
183
- * License options section callback
184
- *
185
- * @since 1.0.0
186
- */
187
- function mtphr_dnt_license_settings_callback() {
188
- echo '<p>'.__( 'Add the licenses for each of your extensions.', 'ditty-news-ticker' ).'</p>';
189
  }
190
 
191
 
33
  /**
34
  * Setup the custom options for the settings page
35
  *
36
+ * @since 1.0.6
37
  */
38
  function mtphr_dnt_initialize_settings() {
39
 
55
  /* Register the general options */
56
  add_settings_section(
57
  'mtphr_dnt_general_settings_section', // ID used to identify this section and with which to register options
58
+ '', // Title to be displayed on the administration page
59
+ 'mtphr_dnt_general_settings_callback', // Callback used to render the description of the section
60
  'mtphr_dnt_general_settings' // Page on which to add this section of options
61
  );
62
 
71
 
72
  // Register the fields with WordPress
73
  register_setting( 'mtphr_dnt_general_settings', 'mtphr_dnt_general_settings' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  }
75
 
76
 
79
  /**
80
  * Render the theme options page
81
  *
82
+ * @since 1.0.6
83
  */
84
  function mtphr_dnt_settings_display( $active_tab = null ) {
85
  ?>
90
  <h2><?php _e( 'Ditty News Ticker Settings', 'ditty-news-ticker' ); ?></h2>
91
  <?php settings_errors(); ?>
92
 
93
+ <?php
94
+ $tabs = mtphr_dnt_settings_tabs();
95
+ $active_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'general';
 
 
 
 
 
96
  ?>
97
+
98
+ <ul style="margin-bottom:20px;" class="subsubsub">
99
+ <?php
100
+ $num_tabs = count($tabs);
101
+ $count = 0;
102
+ foreach( $tabs as $key=>$tab ) {
103
+ $count++;
104
+ $current = ($key==$active_tab) ? 'class="current"' : '';
105
+ $sep = ($count!=$num_tabs) ? ' |' : '';
106
+ echo '<li><a href="?post_type=ditty_news_ticker&page=mtphr_dnt_settings&tab='.$key.'" '.$current.'>'.ucfirst($key).'</a>'.$sep.'</li>';
107
+ }
108
+ ?>
109
+ </ul>
110
+
111
+ <br class="clear" />
112
 
113
  <form method="post" action="options.php">
114
  <?php
115
+ settings_fields( $tabs[$active_tab] );
116
+ do_settings_sections( $tabs[$active_tab] );
117
+ submit_button();
 
 
 
 
 
 
 
 
 
118
  ?>
119
  </form>
120
 
128
  /**
129
  * General options section callback
130
  *
131
+ * @since 1.0.6
132
  */
133
  function mtphr_dnt_general_settings_callback() {
134
+ ?>
135
+ <div style="margin-bottom: 20px;">
136
+ <h4 style="margin-top:0;"><?php _e( 'The global settings to your news tickers.', 'ditty-news-ticker' ); ?></h4>
137
+ </div>
138
+ <?php
 
 
 
 
 
 
139
  }
140
 
141
 
readme.txt CHANGED
@@ -52,6 +52,10 @@ Each individual Ticker post has multiple settings to customize.
52
 
53
  == Changelog ==
54
 
 
 
 
 
55
  = 1.0.5 =
56
  * Updated metaboxer scripts.
57
  * Updated direct function output.
@@ -81,6 +85,9 @@ Each individual Ticker post has multiple settings to customize.
81
 
82
  == Upgrade Notice ==
83
 
 
 
 
84
  = 1.0.5 =
85
  Updated metaboxer scripts. Updated direct function output. Updated ticker types link. Fixed rotator numbers padding. Fixed limited number of DNT in widget drop down issue.
86
 
52
 
53
  == Changelog ==
54
 
55
+ = 1.0.6 =
56
+ * Updated settings scripts for extensibility.
57
+ * Minor update to metaboxer css.
58
+
59
  = 1.0.5 =
60
  * Updated metaboxer scripts.
61
  * Updated direct function output.
85
 
86
  == Upgrade Notice ==
87
 
88
+ = 1.0.6 =
89
+ Updated settings scripts for extensibility. Minor update to metaboxer css.
90
+
91
  = 1.0.5 =
92
  Updated metaboxer scripts. Updated direct function output. Updated ticker types link. Fixed rotator numbers padding. Fixed limited number of DNT in widget drop down issue.
93