Ditty News Ticker - Version 1.4.4

Version Description

  • Made ditty_new_ticker post type public
  • Included ditty_new_ticker post type in nav menus
  • Filtered single post content to display the ticker on ditty_new_ticker single posts
  • Added additional metabox jquery for lists and sortables
Download this release

Release Info

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

Code changes from version 1.4.3 to 1.4.4

assets/js/script-admin.js CHANGED
@@ -126,6 +126,117 @@ jQuery( document ).ready( function($) {
126
  });
127
 
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
 
130
  /* --------------------------------------------------------- */
131
  /* !Default tick list - 1.4.0 */
126
  });
127
 
128
 
129
+ /* --------------------------------------------------------- */
130
+ /* !Sort list - 1.4.4 */
131
+ /* --------------------------------------------------------- */
132
+
133
+ if( $('.mtphr-dnt-sort-list').length > 0 ) {
134
+
135
+ $('.mtphr-dnt-sort-list').sortable( {
136
+ handle: '.mtphr-dnt-list-handle',
137
+ items: '.mtphr-dnt-list-item',
138
+ axis: 'y',
139
+ helper: function(e, tr) {
140
+ var $originals = tr.children();
141
+ var $helper = tr.clone();
142
+ $helper.children().each(function(index) {
143
+ $(this).width($originals.eq(index).width());
144
+ $(this).height($originals.eq(index).height());
145
+ });
146
+ return $helper;
147
+ },
148
+ });
149
+ }
150
+
151
+
152
+ /* --------------------------------------------------------- */
153
+ /* !Advanced list - 1.4.4 */
154
+ /* --------------------------------------------------------- */
155
+
156
+ if( $('.mtphr-dnt-advanced-list').length > 0 ) {
157
+
158
+ function mtphr_dnt_advanced_handle_toggle( $table ) {
159
+ if( $table.find('.mtphr-dnt-list-item').length > 1 ) {
160
+ $table.find('.mtphr-dnt-list-handle').show();
161
+ $table.find('.mtphr-dnt-list-delete').show();
162
+ } else {
163
+ $table.find('.mtphr-dnt-list-handle').hide();
164
+ $table.find('.mtphr-dnt-list-delete').hide();
165
+ }
166
+ }
167
+
168
+ function mtphr_dnt_advanced_set_order( $table ) {
169
+
170
+ $table.find('.mtphr-dnt-list-item').each( function(index) {
171
+ $(this).find('textarea, input, select').each( function() {
172
+
173
+ var name = $(this).attr('data-name'),
174
+ key = $(this).attr('data-key');
175
+
176
+ $(this).attr('name', name+'['+index+']['+key+']');
177
+ });
178
+ });
179
+
180
+ mtphr_dnt_advanced_handle_toggle( $table );
181
+ }
182
+
183
+ $('.mtphr-dnt-advanced-list').sortable( {
184
+ handle: '.mtphr-dnt-list-handle',
185
+ items: '.mtphr-dnt-list-item',
186
+ axis: 'y',
187
+ helper: function(e, tr) {
188
+ var $originals = tr.children();
189
+ var $helper = tr.clone();
190
+ $helper.children().each(function(index) {
191
+ $(this).width($originals.eq(index).width());
192
+ $(this).height($originals.eq(index).height());
193
+ });
194
+ return $helper;
195
+ },
196
+ });
197
+
198
+ // Delete list item
199
+ $('.mtphr-dnt-advanced-list').find('.mtphr-dnt-list-delete').live( 'click', function(e) {
200
+ e.preventDefault();
201
+
202
+ var $table = $(this).parents('.mtphr-dnt-advanced-list');
203
+
204
+ // Fade out the item
205
+ $(this).parents('.mtphr-dnt-list-item').fadeOut( function() {
206
+ $(this).remove();
207
+ mtphr_dnt_advanced_set_order( $table );
208
+ });
209
+ });
210
+
211
+ // Add new row
212
+ $('.mtphr-dnt-advanced-list').find('.mtphr-dnt-list-add').live( 'click', function(e) {
213
+ e.preventDefault();
214
+
215
+ // Save the container
216
+ var $table = $(this).parents('.mtphr-dnt-advanced-list'),
217
+ $container = $(this).parents('.mtphr-dnt-list-item'),
218
+ $dup = $container.clone();
219
+
220
+ // Reset the duplicate
221
+ $dup.find('textarea, input, select').each( function() {
222
+ $(this).val('');
223
+ });
224
+
225
+ // Add the duplicate
226
+ $dup.hide();
227
+ $container.after( $dup );
228
+ $dup.fadeIn();
229
+
230
+ // Set the order
231
+ mtphr_dnt_advanced_set_order( $table );
232
+ });
233
+
234
+ $('.mtphr-dnt-advanced-list').each( function(index) {
235
+ mtphr_dnt_advanced_set_order( $(this) );
236
+ });
237
+ }
238
+
239
+
240
 
241
  /* --------------------------------------------------------- */
242
  /* !Default tick list - 1.4.0 */
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.4.3
7
  Author: Metaphor Creations
8
  Author URI: http://www.metaphorcreations.com
9
  License: GPL2
@@ -34,9 +34,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34
  * @since 1.4.2
35
  */
36
  if ( WP_DEBUG ) {
37
- define ( 'MTPHR_DNT_VERSION', '1.4.3-'.time() );
38
  } else {
39
- define ( 'MTPHR_DNT_VERSION', '1.4.3' );
40
  }
41
  define ( 'MTPHR_DNT_DIR', plugin_dir_path(__FILE__) );
42
  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.4.4
7
  Author: Metaphor Creations
8
  Author URI: http://www.metaphorcreations.com
9
  License: GPL2
34
  * @since 1.4.2
35
  */
36
  if ( WP_DEBUG ) {
37
+ define ( 'MTPHR_DNT_VERSION', '1.4.4-'.time() );
38
  } else {
39
+ define ( 'MTPHR_DNT_VERSION', '1.4.4' );
40
  }
41
  define ( 'MTPHR_DNT_DIR', plugin_dir_path(__FILE__) );
42
  define ( 'MTPHR_DNT_URL', plugins_url().'/ditty-news-ticker' );
includes/filters.php CHANGED
@@ -1,5 +1,25 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  function mtphr_dnt_tick_grid( $dnt_ticks, $id, $meta_data ) {
4
 
5
  // Extract the metadata array into variables
1
  <?php
2
 
3
+ /* --------------------------------------------------------- */
4
+ /* !Filter the post content to display the ticker - 1.0.0 */
5
+ /* --------------------------------------------------------- */
6
+
7
+ function mtphr_dnt_content( $content ) {
8
+
9
+ if( get_post_type() == 'ditty_news_ticker' ) {
10
+ return '[ditty_news_ticker id="'.get_the_id().'"]';
11
+ }
12
+
13
+ return $content;
14
+ }
15
+ add_filter( 'the_content', 'mtphr_dnt_content' );
16
+
17
+
18
+
19
+ /* --------------------------------------------------------- */
20
+ /* !Make a grid out of the ticks - 1.4.0 */
21
+ /* --------------------------------------------------------- */
22
+
23
  function mtphr_dnt_tick_grid( $dnt_ticks, $id, $meta_data ) {
24
 
25
  // Extract the metadata array into variables
includes/post-types.php CHANGED
@@ -12,7 +12,7 @@ add_action( 'init','mtphr_dnt_posttype' );
12
  /**
13
  * Add post types
14
  *
15
- * @since 1.0.0
16
  */
17
  function mtphr_dnt_posttype() {
18
 
@@ -34,7 +34,7 @@ function mtphr_dnt_posttype() {
34
  // Create the arguments
35
  $args = array(
36
  'labels' => $labels,
37
- 'public' => false,
38
  'publicly_queryable' => true,
39
  'exclude_from_search' => true,
40
  'show_ui' => true,
@@ -42,7 +42,8 @@ function mtphr_dnt_posttype() {
42
  'query_var' => true,
43
  'rewrite' => true,
44
  'supports' => array( 'title' ),
45
- 'show_in_nav_menus' => false
 
46
  );
47
 
48
  register_post_type( 'ditty_news_ticker', $args );
12
  /**
13
  * Add post types
14
  *
15
+ * @since 1.4.4
16
  */
17
  function mtphr_dnt_posttype() {
18
 
34
  // Create the arguments
35
  $args = array(
36
  'labels' => $labels,
37
+ 'public' => true,
38
  'publicly_queryable' => true,
39
  'exclude_from_search' => true,
40
  'show_ui' => true,
42
  'query_var' => true,
43
  'rewrite' => true,
44
  'supports' => array( 'title' ),
45
+ 'rewrite' => array( 'slug' => __( 'ticker', 'ditty-news-ticker' ) ),
46
+ 'show_in_nav_menus' => true
47
  );
48
 
49
  register_post_type( 'ditty_news_ticker', $args );
readme.txt CHANGED
@@ -54,6 +54,12 @@ Each individual Ticker post has multiple settings to customize.
54
 
55
  == Changelog ==
56
 
 
 
 
 
 
 
57
  = 1.4.3 =
58
  * Fixed bug in jQuery setup where extra characters where being written
59
 
@@ -211,4 +217,4 @@ Each individual Ticker post has multiple settings to customize.
211
 
212
  == Upgrade Notice ==
213
 
214
- Fixed bug in jQuery setup where extra characters where being written
54
 
55
  == Changelog ==
56
 
57
+ = 1.4.4 =
58
+ * Made ditty_new_ticker post type public
59
+ * Included ditty_new_ticker post type in nav menus
60
+ * Filtered single post content to display the ticker on ditty_new_ticker single posts
61
+ * Added additional metabox jquery for lists and sortables
62
+
63
  = 1.4.3 =
64
  * Fixed bug in jQuery setup where extra characters where being written
65
 
217
 
218
  == Upgrade Notice ==
219
 
220
+ Made News Ticker plublic and added to nave menus. Other admin script updates.