Permalink
Browse files

Formatting code and comments in classes.

  • Loading branch information...
1 parent 4f241b8 commit 099c2267f75f622d796859df41e5bb5cfd136a62 @justintadlock committed Sep 7, 2012
@@ -3,12 +3,12 @@
* The textarea customize control extends the WP_Customize_Control class. This class allows
* developers to create textarea settings within the WordPress theme customizer.
*
- * @package Hybrid
+ * @package Hybrid
* @subpackage Classes
- * @author Justin Tadlock <justin@justintadlock.com>
- * @copyright Copyright (c) 2008 - 2012, Justin Tadlock
- * @link http://themehybrid.com/hybrid-core
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * @author Justin Tadlock <justin@justintadlock.com>
+ * @copyright Copyright (c) 2008 - 2012, Justin Tadlock
+ * @link http://themehybrid.com/hybrid-core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
/**
@@ -4,12 +4,12 @@
* control over the output to the user by allowing the input of all the arguments typically seen
* in the wp_get_archives() function.
*
- * @package Hybrid
+ * @package Hybrid
* @subpackage Classes
- * @author Justin Tadlock <justin@justintadlock.com>
- * @copyright Copyright (c) 2008 - 2012, Justin Tadlock
- * @link http://themehybrid.com/hybrid-core
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * @author Justin Tadlock <justin@justintadlock.com>
+ * @copyright Copyright (c) 2008 - 2012, Justin Tadlock
+ * @link http://themehybrid.com/hybrid-core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
/**
@@ -28,22 +28,22 @@ function __construct() {
/* Set up the widget options. */
$widget_options = array(
- 'classname' => 'archives',
+ 'classname' => 'archives',
'description' => esc_html__( 'An advanced widget that gives you total control over the output of your archives.', 'hybrid-core' )
);
/* Set up the widget control options. */
$control_options = array(
- 'width' => 525,
+ 'width' => 525,
'height' => 350
);
/* Create the widget. */
$this->WP_Widget(
- 'hybrid-archives', // $this->id_base
- __( 'Archives', 'hybrid-core' ), // $this->name
- $widget_options, // $this->widget_options
- $control_options // $this->control_options
+ 'hybrid-archives', // $this->id_base
+ __( 'Archives', 'hybrid-core' ), // $this->name
+ $widget_options, // $this->widget_options
+ $control_options // $this->control_options
);
}
@@ -120,10 +120,11 @@ function update( $new_instance, $old_instance ) {
$instance = $new_instance;
- $instance['title'] = strip_tags( $new_instance['title'] );
+ $instance['title'] = strip_tags( $new_instance['title'] );
$instance['before'] = strip_tags( $new_instance['before'] );
- $instance['after'] = strip_tags( $new_instance['after'] );
- $instance['limit'] = strip_tags( $new_instance['limit'] );
+ $instance['after'] = strip_tags( $new_instance['after'] );
+ $instance['limit'] = strip_tags( $new_instance['limit'] );
+
$instance['show_post_count'] = ( isset( $new_instance['show_post_count'] ) ? 1 : 0 );
return $instance;
@@ -138,23 +139,34 @@ function form( $instance ) {
/* Set up the default form values. */
$defaults = array(
- 'title' => esc_attr__( 'Archives', 'hybrid-core' ),
- 'limit' => 10,
- 'type' => 'monthly',
- 'format' => 'html',
- 'before' => '',
- 'after' => '',
+ 'title' => esc_attr__( 'Archives', 'hybrid-core' ),
+ 'limit' => 10,
+ 'type' => 'monthly',
+ 'format' => 'html',
+ 'before' => '',
+ 'after' => '',
'show_post_count' => false
);
/* Merge the user-selected arguments with the defaults. */
$instance = wp_parse_args( (array) $instance, $defaults );
/* Create an array of archive types. */
- $type = array( 'alpha' => esc_attr__( 'Alphabetical', 'hybrid-core' ), 'daily' => esc_attr__( 'Daily', 'hybrid-core' ), 'monthly' => esc_attr__( 'Monthly', 'hybrid-core' ),'postbypost' => esc_attr__( 'Post By Post', 'hybrid-core' ), 'weekly' => esc_attr__( 'Weekly', 'hybrid-core' ), 'yearly' => esc_attr__( 'Yearly', 'hybrid-core' ) );
+ $type = array(
+ 'alpha' => esc_attr__( 'Alphabetical', 'hybrid-core' ),
+ 'daily' => esc_attr__( 'Daily', 'hybrid-core' ),
+ 'monthly' => esc_attr__( 'Monthly', 'hybrid-core' ),
+ 'postbypost' => esc_attr__( 'Post By Post', 'hybrid-core' ),
+ 'weekly' => esc_attr__( 'Weekly', 'hybrid-core' ),
+ 'yearly' => esc_attr__( 'Yearly', 'hybrid-core' )
+ );
/* Create an array of archive formats. */
- $format = array( 'custom' => esc_attr__( 'Custom', 'hybrid-core' ), 'html' => esc_attr__( 'HTML', 'hybrid-core' ), 'option' => esc_attr__( 'Option', 'hybrid-core' ) );
+ $format = array(
+ 'custom' => esc_attr__( 'Custom', 'hybrid-core' ),
+ 'html' => esc_attr__( 'HTML', 'hybrid-core' ),
+ 'option' => esc_attr__( 'Option', 'hybrid-core' )
+ );
?>
<div class="hybrid-widget-controls columns-2">
@@ -4,12 +4,12 @@
* there was no equivalent WordPress widget that offered the functionality. This widget allows full
* control over its output by giving access to the parameters of wp_list_authors().
*
- * @package Hybrid
+ * @package Hybrid
* @subpackage Classes
- * @author Justin Tadlock <justin@justintadlock.com>
- * @copyright Copyright (c) 2008 - 2012, Justin Tadlock
- * @link http://themehybrid.com/hybrid-core
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * @author Justin Tadlock <justin@justintadlock.com>
+ * @copyright Copyright (c) 2008 - 2012, Justin Tadlock
+ * @link http://themehybrid.com/hybrid-core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
/**
@@ -28,22 +28,22 @@ function __construct() {
/* Set up the widget options. */
$widget_options = array(
- 'classname' => 'authors',
+ 'classname' => 'authors',
'description' => esc_html__( 'An advanced widget that gives you total control over the output of your author lists.', 'hybrid-core' )
);
/* Set up the widget control options. */
$control_options = array(
- 'width' => 525,
+ 'width' => 525,
'height' => 350
);
/* Create the widget. */
$this->WP_Widget(
- 'hybrid-authors', // $this->id_base
- __( 'Authors', 'hybrid-core' ), // $this->name
- $widget_options, // $this->widget_options
- $control_options // $this->control_options
+ 'hybrid-authors', // $this->id_base
+ __( 'Authors', 'hybrid-core' ), // $this->name
+ $widget_options, // $this->widget_options
+ $control_options // $this->control_options
);
}
@@ -96,17 +96,17 @@ function update( $new_instance, $old_instance ) {
$instance = $new_instance;
- $instance['title'] = strip_tags( $new_instance['title'] );
- $instance['feed'] = strip_tags( $new_instance['feed'] );
- $instance['order'] = strip_tags( $new_instance['order'] );
+ $instance['title'] = strip_tags( $new_instance['title'] );
+ $instance['feed'] = strip_tags( $new_instance['feed'] );
+ $instance['order'] = strip_tags( $new_instance['order'] );
$instance['orderby'] = strip_tags( $new_instance['orderby'] );
- $instance['number'] = strip_tags( $new_instance['number'] );
+ $instance['number'] = strip_tags( $new_instance['number'] );
- $instance['html'] = ( isset( $new_instance['html'] ) ? 1 : 0 );
- $instance['optioncount'] = ( isset( $new_instance['optioncount'] ) ? 1 : 0 );
+ $instance['html'] = ( isset( $new_instance['html'] ) ? 1 : 0 );
+ $instance['optioncount'] = ( isset( $new_instance['optioncount'] ) ? 1 : 0 );
$instance['exclude_admin'] = ( isset( $new_instance['exclude_admin'] ) ? 1 : 0 );
$instance['show_fullname'] = ( isset( $new_instance['show_fullname'] ) ? 1 : 0 );
- $instance['hide_empty'] = ( isset( $new_instance['hide_empty'] ) ? 1 : 0 );
+ $instance['hide_empty'] = ( isset( $new_instance['hide_empty'] ) ? 1 : 0 );
return $instance;
}
@@ -120,25 +120,38 @@ function form( $instance ) {
/* Set up the default form values. */
$defaults = array(
- 'title' => esc_attr__( 'Authors', 'hybrid-core' ),
- 'order' => 'ASC',
- 'orderby' => 'display_name',
- 'number' => '',
- 'optioncount' => false,
+ 'title' => esc_attr__( 'Authors', 'hybrid-core' ),
+ 'order' => 'ASC',
+ 'orderby' => 'display_name',
+ 'number' => '',
+ 'optioncount' => false,
'exclude_admin' => false,
'show_fullname' => true,
- 'hide_empty' => true,
- 'style' => 'list',
- 'html' => true,
- 'feed' => '',
- 'feed_image' => ''
+ 'hide_empty' => true,
+ 'style' => 'list',
+ 'html' => true,
+ 'feed' => '',
+ 'feed_image' => ''
);
/* Merge the user-selected arguments with the defaults. */
$instance = wp_parse_args( (array) $instance, $defaults );
- $order = array( 'ASC' => esc_attr__( 'Ascending', 'hybrid-core' ), 'DESC' => esc_attr__( 'Descending', 'hybrid-core' ) );
- $orderby = array( 'display_name' => esc_attr__( 'Display Name', 'hybrid-core' ), 'email' => esc_attr__( 'Email', 'hybrid-core' ), 'ID' => esc_attr__( 'ID', 'hybrid-core' ), 'nicename' => esc_attr__( 'Nice Name', 'hybrid-core' ), 'post_count' => esc_attr__( 'Post Count', 'hybrid-core' ), 'registered' => esc_attr__( 'Registered', 'hybrid-core' ), 'url' => esc_attr__( 'URL', 'hybrid-core' ), 'user_login' => esc_attr__( 'Login', 'hybrid-core' ) );
+ $order = array(
+ 'ASC' => esc_attr__( 'Ascending', 'hybrid-core' ),
+ 'DESC' => esc_attr__( 'Descending', 'hybrid-core' )
+ );
+
+ $orderby = array(
+ 'display_name' => esc_attr__( 'Display Name', 'hybrid-core' ),
+ 'email' => esc_attr__( 'Email', 'hybrid-core' ),
+ 'ID' => esc_attr__( 'ID', 'hybrid-core' ),
+ 'nicename' => esc_attr__( 'Nice Name', 'hybrid-core' ),
+ 'post_count' => esc_attr__( 'Post Count', 'hybrid-core' ),
+ 'registered' => esc_attr__( 'Registered', 'hybrid-core' ),
+ 'url' => esc_attr__( 'URL', 'hybrid-core' ),
+ 'user_login' => esc_attr__( 'Login', 'hybrid-core' )
+ );
?>
Oops, something went wrong. Retry.

0 comments on commit 099c226

Please sign in to comment.