Changeset 472932
- Timestamp:
- 12/09/2011 07:47:40 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dj-rotator-for-wordpress/trunk/dj-rotator-for-wordpress.php
r468855 r472932 5 5 Description: Easily create a DJ Rotator to display which personality is currently on-air. You can upload/delete deejays via the <a href="options-general.php?page=dj-rotator">options panel</a>. To display the DJ Rotator in your theme, use one of the following: 1) <a href="widgets.php">Widget</a>, 2) Template Tag <code><?php djwp(); ?></code>, or 3) Shortcode <code>[djwp]</code>. 6 6 Author: Greg Rickaby 7 Version: 0.0. 47 Version: 0.0.5 8 8 Author URI: http://gregrickaby.com 9 9 Notes: Big thanks to Nathan Rice and his WP-Cycle Plugin which got me started in the right direction. … … 349 349 <td> 350 350 <input type="text" name="djwp_settings[header_text]" value="<?php echo $options['header_text'] ?>" class="regular-text" /> 351 <p><span class="description"><?php _e( 'Give the module a name. Default: <code>On-Air Now</code>', 'djwp' ); ?></span></p>351 <p><span class="description"><?php _e( 'Give the module a name. Only applies to Template Tag and Shortcode. Default: <code>On-Air Now</code>', 'djwp' ); ?></span></p> 352 352 </td> 353 353 </tr> … … 376 376 <td> 377 377 <input type="text" name="djwp_settings[div]" value="<?php echo $options['div'] ?>" class="regular-text code" /> 378 <p><span class="description"><?php _e( 'Set the CSS <code>ID</code> of the module. Default: <code>dj-rotator</code>', 'djwp' ); ?></span></p>378 <p><span class="description"><?php _e( 'Set the CSS <code>ID</code> of the module. Only applies to Template Tag and Shortcode. Default: <code>dj-rotator</code>', 'djwp' ); ?></span></p> 379 379 </td> 380 380 </tr> … … 383 383 <td> 384 384 <input type="text" name="djwp_settings[header_class]" value="<?php echo $options['header_class'] ?>" class="regular-text code" /> 385 <p><span class="description"><?php _e( 'Set the CSS <code>class</code> of the <code><h3></code>. Default: <code>dj-header</code>', 'djwp' ); ?></span></p>385 <p><span class="description"><?php _e( 'Set the CSS <code>class</code> of the <code><h3></code>. Only applies to Template Tag and Shortcode. Default: <code>dj-header</code>', 'djwp' ); ?></span></p> 386 386 </td> 387 387 </tr> … … 467 467 </p> 468 468 469 <p><span class="description"><?php _e( 'To display the DJ Rotator in your theme, use one of the following: 1) <a href="widgets.php">Widget</a>, 2) Template Tag <code><?php djwp(); ?></code>, or 3) Shortcode <code>[djwp]</code> For support visit <a href="http://gregrickaby.com/go/dj-rotator-for-wordpress" target="_blank">http://gregrickaby.com/</a>', 'djwp' ); ?></span></p>469 <p><span class="description"><?php _e( 'To display the DJ Rotator in your theme, use one of the following: 1) <a href="widgets.php">Widget</a>, 2) Template Tag <code><?php djwp(); ?></code>, or 3) Shortcode <code>[djwp]</code><br />HTML is allowed in the description field.<br />For support visit: <a href="http://wordpress.org/tags/dj-rotator-for-wordpress" target="_blank">http://wordpress.org/tags/dj-rotator-for-wordpress</a>', 'djwp' ); ?></span></p> 470 470 471 471 <?php … … 484 484 $input['img_width'] = intval($input['img_width']); 485 485 $input['img_height'] = intval($input['img_height']); 486 $input['start_time'] = wp_filter_nohtml_kses($input['start_time']); 487 $input['end_time'] = wp_filter_nohtml_kses($input['end_time']); 486 488 $input['div'] = wp_filter_nohtml_kses($input['div']); 487 489 $input['header_class'] = wp_filter_nohtml_kses($input['header_class']); … … 645 647 646 648 /** 647 * Mash it all together and form our primary function 649 * Mash it all together and form our primary function (Template Tag & Shortcode) 648 650 * @since 0.0.1 649 651 * … … 658 660 } 659 661 662 /** 663 * Mash it all together and form our primary function (Sidebar Widget) 664 * @since 0.0.5 665 * 666 */ 667 function djwp_widget($args = array(), $content = null) { 668 global $djwp_settings; 669 djwp_image(); 670 djwp_description(); 671 } 672 660 673 661 674 /** … … 674 687 /** 675 688 * Create the Widget 676 * @since 0.0. 4689 * @since 0.0.5 677 690 * 678 691 */ … … 684 697 } 685 698 686 // write the widget 687 function widget() { 688 djwp(); 689 } 690 691 } 699 /** @see WP_Widget::widget */ 700 function widget( $args, $instance ) { 701 extract( $args ); 702 $title = apply_filters( 'widget_title', $instance['title'] ); 703 echo djwp_before_header(); #hook 704 echo $before_widget; 705 if ( $title ) 706 echo $before_title . $title . $after_title; 707 echo djwp_after_header(); #hook 708 echo djwp_widget(); 709 echo $after_widget; 710 } 711 712 /** @see WP_Widget::update */ 713 function update( $new_instance, $old_instance ) { 714 $instance = $old_instance; 715 $instance['title'] = strip_tags($new_instance['title']); 716 return $instance; 717 } 718 719 /** @see WP_Widget::form */ 720 function form( $instance ) { 721 if ( $instance ) { 722 $title = esc_attr( $instance[ 'title' ] ); 723 } 724 else { 725 $title = __( 'On-Air Now', 'text_domain' ); 726 } 727 ?> 728 <p> 729 <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> 730 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /> 731 </p> 732 <?php 733 } 734 }
Note: See TracChangeset
for help on using the changeset viewer.