Plugin Directory

Changeset 1501784


Ignore:
Timestamp:
09/24/2016 05:28:28 AM (9 years ago)
Author:
trepmal
Message:

tag 0.5

Location:
capitalporg-quote-widget
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • capitalporg-quote-widget/trunk/capitalp-widget.php

    r1128234 r1501784  
    44 * Plugin URI: http://trepmal.com/2011/12/30/capitalp-org-wordpress-widget/
    55 * Description: Grab a quote from capitalp.org, display it.
    6  * Version: 0.4
     6 * Version: 0.5
    77 * TextDomain: capitalp-widget
    88 * Author: Kailey Lampert
     
    7171     */
    7272    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        );
    7477        $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 );
    7679    }
    7780
     
    8184
    8285        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        }
    8491
    8592        $raw_quote = capitalp_get_quote();
     
    100107    /**
    101108     */
    102     function update($new_instance, $old_instance) {
     109    function update( $new_instance, $old_instance ) {
    103110
    104111        $instance = $old_instance;
     
    114121    function form( $instance ) {
    115122        $instance = wp_parse_args( (array) $instance, array(
    116                 'title'         => 'CapitalP.org Quote',
    117                 'hide_title'    => 0,
    118                 'hide_citation' => 0
    119             ) );
     123            'title'         => 'CapitalP.org Quote',
     124            'hide_title'    => 0,
     125            'hide_citation' => 0
     126        ) );
    120127
    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'];
    123131        ?>
    124132        <p>
     
    127135            </label>
    128136        </p>
    129         <p style="width:50%;float:left;height:20px;">
     137        <p>
    130138            <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 ); ?> />
    131139            <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 />
    134141            <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 ); ?> />
    135142            <label for="<?php echo $this->get_field_id('hide_citation'); ?>"><?php _e( 'Hide Citation?', 'capitalp-widget' );?></label>
    136143        </p>
    137         <br style="clear:both;" />
     144
    138145        <?php
    139146    }
  • capitalporg-quote-widget/trunk/readme.txt

    r1128234 r1501784  
    1212
    1313Grab 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.
    1614
    1715Has shortcode! `[capitalp]`
     
    6260== Changelog ==
    6361
     62= 0.5 =
     63* maintenance
     64
    6465= 0.4 =
    6566* 2015 checkin. Cleanup, longer transients
Note: See TracChangeset for help on using the changeset viewer.