Version Description
- Modified post_updated message.
- Add a ticker (auto) width override setting.
Download this release
Release Info
Developer | metaphorcreations |
Plugin | Ditty News Ticker |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- ditty-news-ticker.php +3 -3
- includes/functions.php +11 -2
- includes/meta-boxes.php +17 -19
- includes/metaboxer/metaboxer.php +3 -1
- includes/post-types.php +16 -0
- readme.txt +11 -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.0.
|
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.
|
49 |
} else {
|
50 |
-
define ( 'MTPHR_DNT_VERSION', '1.0.
|
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.3
|
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.3-'.time() );
|
49 |
} else {
|
50 |
+
define ( 'MTPHR_DNT_VERSION', '1.0.3' );
|
51 |
}
|
52 |
define ( 'MTPHR_DNT_DIR', plugin_dir_path(__FILE__) );
|
53 |
define ( 'MTPHR_DNT_URL', plugins_url().'/ditty-news-ticker' );
|
includes/functions.php
CHANGED
@@ -22,7 +22,7 @@ function ditty_news_ticker( $id='', $class='', $atts=false ) {
|
|
22 |
/**
|
23 |
* Return the ticker
|
24 |
*
|
25 |
-
* @since 1.0.
|
26 |
*/
|
27 |
function get_mtphr_dnt_ticker( $id='', $class='', $atts=false ) {
|
28 |
|
@@ -89,7 +89,16 @@ function get_mtphr_dnt_ticker( $id='', $class='', $atts=false ) {
|
|
89 |
$tick_id = 'mtphr-dnt-'.$id.'-'.sanitize_html_class( $_mtphr_dnt_unique_id );
|
90 |
}
|
91 |
}
|
92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
echo '<div class="mtphr-dnt-wrapper">';
|
94 |
|
95 |
// Display the title
|
22 |
/**
|
23 |
* Return the ticker
|
24 |
*
|
25 |
+
* @since 1.0.3
|
26 |
*/
|
27 |
function get_mtphr_dnt_ticker( $id='', $class='', $atts=false ) {
|
28 |
|
89 |
$tick_id = 'mtphr-dnt-'.$id.'-'.sanitize_html_class( $_mtphr_dnt_unique_id );
|
90 |
}
|
91 |
}
|
92 |
+
|
93 |
+
// Check for a set width
|
94 |
+
$ticker_width = '';
|
95 |
+
if( isset($_mtphr_dnt_ticker_width) ) {
|
96 |
+
if( $_mtphr_dnt_ticker_width != 0 ) {
|
97 |
+
$ticker_width = ' style="width:'.intval($_mtphr_dnt_ticker_width).'px"';
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
echo '<div'.$ticker_width.' id="'.$tick_id.'" '.mtphr_dnt_ticker_class( $id, $class, $meta_data ).'>';
|
102 |
echo '<div class="mtphr-dnt-wrapper">';
|
103 |
|
104 |
// Display the title
|
includes/meta-boxes.php
CHANGED
@@ -338,7 +338,7 @@ function mtphr_dnt_mode_metabox_rotate() {
|
|
338 |
$rotate_fields['rotate_directional_nav'] = array(
|
339 |
'id' => '_mtphr_dnt_rotate_directional_nav',
|
340 |
'type' => 'checkbox',
|
341 |
-
'name' => __('Directional
|
342 |
'label' => __('Enable', 'ditty-news-ticker'),
|
343 |
'description' => __('Set the directional navigation options.', 'ditty-news-ticker'),
|
344 |
'append' => array(
|
@@ -353,7 +353,7 @@ function mtphr_dnt_mode_metabox_rotate() {
|
|
353 |
$rotate_fields['rotate_control_nav'] = array(
|
354 |
'id' => '_mtphr_dnt_rotate_control_nav',
|
355 |
'type' => 'checkbox',
|
356 |
-
'name' => __('Control
|
357 |
'label' => __('Enable', 'ditty-news-ticker'),
|
358 |
'description' => __('Set the control navigation options.', 'ditty-news-ticker'),
|
359 |
'append' => array(
|
@@ -441,7 +441,7 @@ add_action( 'admin_init', 'mtphr_dnt_global_settings', 13 );
|
|
441 |
/**
|
442 |
* Create the display metabox.
|
443 |
*
|
444 |
-
* @since 1.0.
|
445 |
*/
|
446 |
function mtphr_dnt_global_settings() {
|
447 |
|
@@ -452,25 +452,23 @@ function mtphr_dnt_global_settings() {
|
|
452 |
$global_fields['title'] = array(
|
453 |
'id' => '_mtphr_dnt_title',
|
454 |
'type' => 'checkbox',
|
455 |
-
'label' => __('Display
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
'label' => __('Inline Title', 'ditty-news-ticker')
|
463 |
);
|
464 |
|
465 |
// Add the title field
|
466 |
-
|
467 |
-
|
468 |
-
'
|
469 |
-
'type' => '
|
470 |
-
'
|
471 |
);
|
472 |
-
|
473 |
-
|
474 |
// Create the metabox
|
475 |
$dnt_global = array(
|
476 |
'id' => 'mtphr_dnt_global_settings',
|
@@ -510,7 +508,7 @@ function mtphr_dnt_display_metabox() {
|
|
510 |
$display_fields['function'] = array(
|
511 |
'id' => '_mtphr_dnt_function',
|
512 |
'type' => 'code',
|
513 |
-
'name' => __('Direct
|
514 |
'button' => __('Select Function', 'ditty-news-ticker'),
|
515 |
'description' => __('Place this code directly into your theme to display the ticker.', 'ditty-news-ticker'),
|
516 |
);
|
338 |
$rotate_fields['rotate_directional_nav'] = array(
|
339 |
'id' => '_mtphr_dnt_rotate_directional_nav',
|
340 |
'type' => 'checkbox',
|
341 |
+
'name' => __('Directional navigation', 'ditty-news-ticker'),
|
342 |
'label' => __('Enable', 'ditty-news-ticker'),
|
343 |
'description' => __('Set the directional navigation options.', 'ditty-news-ticker'),
|
344 |
'append' => array(
|
353 |
$rotate_fields['rotate_control_nav'] = array(
|
354 |
'id' => '_mtphr_dnt_rotate_control_nav',
|
355 |
'type' => 'checkbox',
|
356 |
+
'name' => __('Control navigation', 'ditty-news-ticker'),
|
357 |
'label' => __('Enable', 'ditty-news-ticker'),
|
358 |
'description' => __('Set the control navigation options.', 'ditty-news-ticker'),
|
359 |
'append' => array(
|
441 |
/**
|
442 |
* Create the display metabox.
|
443 |
*
|
444 |
+
* @since 1.0.3
|
445 |
*/
|
446 |
function mtphr_dnt_global_settings() {
|
447 |
|
452 |
$global_fields['title'] = array(
|
453 |
'id' => '_mtphr_dnt_title',
|
454 |
'type' => 'checkbox',
|
455 |
+
'label' => __('Display title', 'ditty-news-ticker'),
|
456 |
+
'append' => array(
|
457 |
+
'_mtphr_dnt_inline_title' => array(
|
458 |
+
'type' => 'checkbox',
|
459 |
+
'label' => __('Inline title', 'ditty-news-ticker')
|
460 |
+
)
|
461 |
+
)
|
|
|
462 |
);
|
463 |
|
464 |
// Add the title field
|
465 |
+
$global_fields['ticker_width'] = array(
|
466 |
+
'id' => '_mtphr_dnt_ticker_width',
|
467 |
+
'before' => __('Ticker width <em>(optional)</em>', 'ditty-news-ticker'),
|
468 |
+
'type' => 'number',
|
469 |
+
'after' => 'px<br/>'.'<small><em>'.__('Override the auto width a with specific value.').'</em></small>'
|
470 |
);
|
471 |
+
|
|
|
472 |
// Create the metabox
|
473 |
$dnt_global = array(
|
474 |
'id' => 'mtphr_dnt_global_settings',
|
508 |
$display_fields['function'] = array(
|
509 |
'id' => '_mtphr_dnt_function',
|
510 |
'type' => 'code',
|
511 |
+
'name' => __('Direct function', 'ditty-news-ticker'),
|
512 |
'button' => __('Select Function', 'ditty-news-ticker'),
|
513 |
'description' => __('Place this code directly into your theme to display the ticker.', 'ditty-news-ticker'),
|
514 |
);
|
includes/metaboxer/metaboxer.php
CHANGED
@@ -325,6 +325,8 @@ function mtphr_dnt_metaboxer_wysiwyg( $field, $value='' ) {
|
|
325 |
function mtphr_dnt_metaboxer_checkbox( $field, $value='' ) {
|
326 |
|
327 |
$output = '';
|
|
|
|
|
328 |
|
329 |
if( isset($field['options']) ) {
|
330 |
|
@@ -349,7 +351,7 @@ function mtphr_dnt_metaboxer_checkbox( $field, $value='' ) {
|
|
349 |
$output .= '</label>';
|
350 |
}
|
351 |
|
352 |
-
echo $output;
|
353 |
|
354 |
// Add appended fields
|
355 |
mtphr_dnt_metaboxer_append_field($field);
|
325 |
function mtphr_dnt_metaboxer_checkbox( $field, $value='' ) {
|
326 |
|
327 |
$output = '';
|
328 |
+
$before = ( isset($field['before']) ) ? '<span>'.$field['before'].' </span>' : '';
|
329 |
+
$after = ( isset($field['after']) ) ? '<span> '.$field['after'].'</span>' : '';
|
330 |
|
331 |
if( isset($field['options']) ) {
|
332 |
|
351 |
$output .= '</label>';
|
352 |
}
|
353 |
|
354 |
+
echo $before.$output.$after;
|
355 |
|
356 |
// Add appended fields
|
357 |
mtphr_dnt_metaboxer_append_field($field);
|
includes/post-types.php
CHANGED
@@ -49,3 +49,19 @@ function mtphr_dnt_posttype() {
|
|
49 |
}
|
50 |
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
|
52 |
+
|
53 |
+
|
54 |
+
add_filter( 'post_updated_messages', 'mtphr_dnt_updated_messages' );
|
55 |
+
/**
|
56 |
+
* Modify the update text
|
57 |
+
*
|
58 |
+
* @since 1.0.3
|
59 |
+
*/
|
60 |
+
function mtphr_dnt_updated_messages( $messages ) {
|
61 |
+
|
62 |
+
$messages['ditty_news_ticker'][1] = __('Ditty News Ticker Updated!', 'ditty-news-ticker');
|
63 |
+
|
64 |
+
return $messages;
|
65 |
+
}
|
66 |
+
|
67 |
+
|
readme.txt
CHANGED
@@ -33,12 +33,16 @@ To see a list of all extensions, visit the [**extensions page**](http://dittynew
|
|
33 |
4. Insert your tickers by copying and pasting the provided shortcode into another post.
|
34 |
5. Optionally, insert your tickers by copying and pasting the direct function code directly into your theme or plugin.
|
35 |
|
|
|
|
|
36 |
== Frequently Asked Questions ==
|
37 |
|
38 |
= Are there any settings I need to configure? =
|
39 |
|
40 |
Each individual Ticker post has multiple settings to customize.
|
41 |
|
|
|
|
|
42 |
== Screenshots ==
|
43 |
|
44 |
1. Default Ticker Type options
|
@@ -48,6 +52,10 @@ Each individual Ticker post has multiple settings to customize.
|
|
48 |
|
49 |
== Changelog ==
|
50 |
|
|
|
|
|
|
|
|
|
51 |
= 1.0.2 =
|
52 |
* Added 'mtphr_dnt_tick_before' and 'mtphr_dnt_tick_after' actions.
|
53 |
* Fixed error in 'rotate_scroll_up' script.
|
@@ -61,6 +69,9 @@ Each individual Ticker post has multiple settings to customize.
|
|
61 |
|
62 |
== Upgrade Notice ==
|
63 |
|
|
|
|
|
|
|
64 |
= 1.0.2 =
|
65 |
Added additional actions along with some code updates.
|
66 |
|
33 |
4. Insert your tickers by copying and pasting the provided shortcode into another post.
|
34 |
5. Optionally, insert your tickers by copying and pasting the direct function code directly into your theme or plugin.
|
35 |
|
36 |
+
[**View full help documentation.**](http://dittynewsticker.com/mc/ditty-news-ticker-doc/)
|
37 |
+
|
38 |
== Frequently Asked Questions ==
|
39 |
|
40 |
= Are there any settings I need to configure? =
|
41 |
|
42 |
Each individual Ticker post has multiple settings to customize.
|
43 |
|
44 |
+
[**View full help documentation.**](http://dittynewsticker.com/mc/ditty-news-ticker-doc/)
|
45 |
+
|
46 |
== Screenshots ==
|
47 |
|
48 |
1. Default Ticker Type options
|
52 |
|
53 |
== Changelog ==
|
54 |
|
55 |
+
= 1.0.3 =
|
56 |
+
* Modified post_updated message.
|
57 |
+
* Add a ticker (auto) width override setting.
|
58 |
+
|
59 |
= 1.0.2 =
|
60 |
* Added 'mtphr_dnt_tick_before' and 'mtphr_dnt_tick_after' actions.
|
61 |
* Fixed error in 'rotate_scroll_up' script.
|
69 |
|
70 |
== Upgrade Notice ==
|
71 |
|
72 |
+
= 1.0.3 =
|
73 |
+
Updates.
|
74 |
+
|
75 |
= 1.0.2 =
|
76 |
Added additional actions along with some code updates.
|
77 |
|