Ditty News Ticker - Version 3.0.20

Version Description

  • Layout tag filter updates
  • Dashboard menu order updates
Download this release

Release Info

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

Code changes from version 3.0.19 to 3.0.20

ditty-news-ticker.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Ditty (formerly Ditty News Ticker)
5
  * Plugin URI: https://www.metaphorcreations.com/ditty
6
  * Description: Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
7
- * Version: 3.0.19
8
  * Author: Metaphor Creations
9
  * Author URI: https://www.metaphorcreations.com
10
  * License: GPL-2.0+
@@ -20,7 +20,7 @@ if ( ! defined( 'WPINC' ) ) {
20
 
21
  // Plugin version.
22
  if ( ! defined( 'DITTY_VERSION' ) ) {
23
- define( 'DITTY_VERSION', '3.0.19' );
24
  }
25
 
26
  // Plugin Folder Path.
4
  * Plugin Name: Ditty (formerly Ditty News Ticker)
5
  * Plugin URI: https://www.metaphorcreations.com/ditty
6
  * Description: Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
7
+ * Version: 3.0.20
8
  * Author: Metaphor Creations
9
  * Author URI: https://www.metaphorcreations.com
10
  * License: GPL-2.0+
20
 
21
  // Plugin version.
22
  if ( ! defined( 'DITTY_VERSION' ) ) {
23
+ define( 'DITTY_VERSION', '3.0.20' );
24
  }
25
 
26
  // Plugin Folder Path.
includes/css/ditty-admin.css CHANGED
@@ -141,20 +141,6 @@ table.wp-list-table .type-ditty_display .row-actions {
141
  background: url("../img/d.svg");
142
  }
143
 
144
- #menu-posts-ditty .wp-submenu {
145
- display: flex;
146
- flex-direction: column;
147
- }
148
- #menu-posts-ditty .wp-submenu li {
149
- order: 0;
150
- }
151
- #menu-posts-ditty .wp-submenu li.ditty_extensions, #menu-posts-ditty .wp-submenu li.ditty_settings, #menu-posts-ditty .wp-submenu li.ditty_export {
152
- order: 5;
153
- }
154
- #menu-posts-ditty .wp-submenu li.ditty_news_ticker, #menu-posts-ditty .wp-submenu li.mtphr_dnt_settings {
155
- order: 10;
156
- }
157
-
158
  .datepicker-container {
159
  background-color: #fff;
160
  direction: ltr;
141
  background: url("../img/d.svg");
142
  }
143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  .datepicker-container {
145
  background-color: #fff;
146
  direction: ltr;
includes/hooks.php CHANGED
@@ -155,6 +155,62 @@ function ditty_dashboard_menu_classes( $classes ) {
155
  }
156
  add_filter( 'admin_body_class', 'ditty_dashboard_menu_classes', 99 );
157
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  /**
159
  * Reorder the Ditty submenus
160
  *
155
  }
156
  add_filter( 'admin_body_class', 'ditty_dashboard_menu_classes', 99 );
157
 
158
+ /**
159
+ * Reorder the menu items
160
+ *
161
+ * @since 3.0.20
162
+ */
163
+ function ditty_dashboard_menu_order( $menu_ord ) {
164
+ global $submenu;
165
+ $current_menu = $submenu['edit.php?post_type=ditty'];
166
+ $current_order = array();
167
+ $new_menu = array();
168
+ $extra_items = array();
169
+ $order = apply_filters( 'ditty_dashboard_menu_order', array(
170
+ 'edit.php?post_type=ditty',
171
+ 'post-new.php?post_type=ditty',
172
+ 'edit.php?post_type=ditty_layout',
173
+ 'edit.php?post_type=ditty_display',
174
+ 'ditty_extensions',
175
+ 'ditty_settings',
176
+ 'ditty_export',
177
+ 'edit.php?post_type=ditty_news_ticker',
178
+ 'mtphr_dnt_settings',
179
+ ), $current_menu );
180
+
181
+ // Find any extra items that aren't in the order list
182
+ foreach ( $current_menu as $i => $item ) {
183
+ $current_order[] = $item[2];
184
+ if ( ! in_array( $item[2], $order ) ) {
185
+ $extra_items[] = $item;
186
+ }
187
+ }
188
+
189
+ // Trim out any extra items in the order so we don't hit an infinite loop
190
+ $order = array_intersect( $order, $current_order );
191
+
192
+ // Set the order of the new menu
193
+ while( count( $order ) > 0 ) {
194
+ foreach ( $current_menu as $i => $item ) {
195
+ if ( count( $order) > 0 && $order[0] == $item[2] ) {
196
+ $new_menu[] = $item;
197
+ array_shift( $order );
198
+ }
199
+ }
200
+ }
201
+
202
+ // Add extra menu items not in the order list
203
+ foreach ( $extra_items as $i => $item ) {
204
+ $new_menu[] = $item;
205
+ }
206
+
207
+ // Set the new menu
208
+ $submenu['edit.php?post_type=ditty'] = $new_menu;
209
+
210
+ return $menu_ord;
211
+ }
212
+ add_filter( 'custom_menu_order', 'ditty_dashboard_menu_order' );
213
+
214
  /**
215
  * Reorder the Ditty submenus
216
  *
includes/layout-tag-hooks-posts.php CHANGED
@@ -75,25 +75,28 @@ add_filter( 'ditty_layout_tags', 'ditty_posts_lite_layout_tags', 10, 2 );
75
  /**
76
  * Filter the available item tags for layout editing
77
  *
78
- * @since 3.0
79
  */
80
  function ditty_posts_lite_layout_tags_list( $tags, $item_type ) {
81
- if ( 'posts_feed' == $item_type || 'post' == $item_type ) {
82
- $allowed_tags = array(
83
- 'author_avatar',
84
- 'author_bio',
85
- 'author_name',
86
- 'categories',
87
- 'content',
88
- 'excerpt',
89
- 'icon',
90
- 'image',
91
- 'image_url',
92
- 'permalink',
93
- 'time',
94
- 'title',
95
- );
96
- $tags = array_intersect_key( $tags, array_flip( $allowed_tags ) );
 
 
 
97
  }
98
  return $tags;
99
  }
75
  /**
76
  * Filter the available item tags for layout editing
77
  *
78
+ * @since 3.0.20
79
  */
80
  function ditty_posts_lite_layout_tags_list( $tags, $item_type ) {
81
+ if ( 'posts_feed' == $item_type ) {
82
+ $item_types = ditty_item_types();
83
+ if ( 'Ditty_Item_Type_Posts_Lite' == $item_types['posts_feed']['class_name'] ) {
84
+ $allowed_tags = array(
85
+ 'author_avatar',
86
+ 'author_bio',
87
+ 'author_name',
88
+ 'categories',
89
+ 'content',
90
+ 'excerpt',
91
+ 'icon',
92
+ 'image',
93
+ 'image_url',
94
+ 'permalink',
95
+ 'time',
96
+ 'title',
97
+ );
98
+ $tags = array_intersect_key( $tags, array_flip( $allowed_tags ) );
99
+ }
100
  }
101
  return $tags;
102
  }
includes/sass/admin/_dashboard.scss CHANGED
@@ -135,23 +135,4 @@ table.wp-list-table .type-ditty_display .row-actions {
135
  width: 15px;
136
  height: 15px;
137
  background: url( '../img/d.svg' );
138
- }
139
-
140
- #menu-posts-ditty {
141
- .wp-submenu {
142
- display: flex;
143
- flex-direction: column;
144
- li {
145
- order: 0;
146
- &.ditty_extensions,
147
- &.ditty_settings,
148
- &.ditty_export {
149
- order: 5;
150
- }
151
- &.ditty_news_ticker,
152
- &.mtphr_dnt_settings {
153
- order: 10;
154
- }
155
- }
156
- }
157
- }
135
  width: 15px;
136
  height: 15px;
137
  background: url( '../img/d.svg' );
138
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: ticker, post ticker, news ticker, content aggregator, latest posts, live refresh, rotator, data rotator, lists, data, aggregator
5
  Requires at least: 4.5
6
  Tested up to: 5.9.3
7
- Stable tag: 3.0.19
8
  License: GPL2
9
 
10
  Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
@@ -66,6 +66,10 @@ The most common cause for an unresponsive Ditty (when using scroll or rotate mod
66
 
67
  == Changelog ==
68
 
 
 
 
 
69
  = 3.0.19 =
70
  * Added input sanitization updates to extensions settings
71
  * Bug fix for List display type autoplay speed
@@ -704,4 +708,4 @@ The most common cause for an unresponsive Ditty (when using scroll or rotate mod
704
 
705
  == Upgrade Notice ==
706
 
707
- Bug fix for List display type autoplay speed
4
  Tags: ticker, post ticker, news ticker, content aggregator, latest posts, live refresh, rotator, data rotator, lists, data, aggregator
5
  Requires at least: 4.5
6
  Tested up to: 5.9.3
7
+ Stable tag: 3.0.20
8
  License: GPL2
9
 
10
  Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
66
 
67
  == Changelog ==
68
 
69
+ = 3.0.20 =
70
+ * Layout tag filter updates
71
+ * Dashboard menu order updates
72
+
73
  = 3.0.19 =
74
  * Added input sanitization updates to extensions settings
75
  * Bug fix for List display type autoplay speed
708
 
709
  == Upgrade Notice ==
710
 
711
+ Layout tag filter updates & Dashboard menu order updates