Changeset 1501784
- Timestamp:
- 09/24/2016 05:28:28 AM (9 years ago)
- Location:
- capitalporg-quote-widget
- Files:
-
- 3 added
- 2 edited
-
tags/0.4 (added)
-
tags/0.4/capitalp-widget.php (added)
-
tags/0.4/readme.txt (added)
-
trunk/capitalp-widget.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
capitalporg-quote-widget/trunk/capitalp-widget.php
r1128234 r1501784 4 4 * Plugin URI: http://trepmal.com/2011/12/30/capitalp-org-wordpress-widget/ 5 5 * Description: Grab a quote from capitalp.org, display it. 6 * Version: 0. 46 * Version: 0.5 7 7 * TextDomain: capitalp-widget 8 8 * Author: Kailey Lampert … … 71 71 */ 72 72 function __construct() { 73 $widget_ops = array('classname' => 'capitalp-widget', 'description' => __( 'Retrieve quote from capitalp.org', 'capitalp-widget' ) ); 73 $widget_ops = array( 74 'classname' => 'capitalp-widget', 75 'description' => __( 'Retrieve quote from capitalp.org', 'capitalp-widget' ) 76 ); 74 77 $control_ops = array( ); 75 parent:: WP_Widget( 'capitalp', __( 'CapitalP.org Quote', 'capitalp-widget' ), $widget_ops, $control_ops );78 parent::__construct( 'capitalp', __( 'CapitalP.org Quote', 'capitalp-widget' ), $widget_ops, $control_ops ); 76 79 } 77 80 … … 81 84 82 85 echo $args['before_widget']; 83 echo $instance['hide_title'] ? '' : $args['before_title'] . $instance['title'] . $args['after_title']; 86 if ( ! $instance['hide_title'] ) { 87 echo $args['before_title']; 88 echo apply_filters( 'widget_title', $instance['title'] ); 89 echo $args['after_title']; 90 } 84 91 85 92 $raw_quote = capitalp_get_quote(); … … 100 107 /** 101 108 */ 102 function update( $new_instance, $old_instance) {109 function update( $new_instance, $old_instance ) { 103 110 104 111 $instance = $old_instance; … … 114 121 function form( $instance ) { 115 122 $instance = wp_parse_args( (array) $instance, array( 116 'title' => 'CapitalP.org Quote',117 'hide_title' => 0,118 'hide_citation' => 0119 ) );123 'title' => 'CapitalP.org Quote', 124 'hide_title' => 0, 125 'hide_citation' => 0 126 ) ); 120 127 121 // $title, $hide_title, $hide_citation 122 extract( $instance ); 128 $title = $instance['title']; 129 $hide_title = $instance['hide_title']; 130 $hide_citation = $instance['hide_citation']; 123 131 ?> 124 132 <p> … … 127 135 </label> 128 136 </p> 129 <p style="width:50%;float:left;height:20px;">137 <p> 130 138 <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('hide_title'); ?>" name="<?php echo $this->get_field_name('hide_title'); ?>"<?php checked( $hide_title ); ?> /> 131 139 <label for="<?php echo $this->get_field_id('hide_title'); ?>"><?php _e( 'Hide Title?', 'capitalp-widget' );?></label> 132 </p> 133 <p style="width:50%;float:right;height:20px;"> 140 <br /> 134 141 <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('hide_citation'); ?>" name="<?php echo $this->get_field_name('hide_citation'); ?>"<?php checked( $hide_citation ); ?> /> 135 142 <label for="<?php echo $this->get_field_id('hide_citation'); ?>"><?php _e( 'Hide Citation?', 'capitalp-widget' );?></label> 136 143 </p> 137 <br style="clear:both;" /> 144 138 145 <?php 139 146 } -
capitalporg-quote-widget/trunk/readme.txt
r1128234 r1501784 12 12 13 13 Grab a quote from capitalp.org, display it. 14 15 Probably works with versions of WP older than 3.3, but I haven't tested it.16 14 17 15 Has shortcode! `[capitalp]` … … 62 60 == Changelog == 63 61 62 = 0.5 = 63 * maintenance 64 64 65 = 0.4 = 65 66 * 2015 checkin. Cleanup, longer transients
Note: See TracChangeset
for help on using the changeset viewer.