Skip to content

Commit

Permalink
Code and inline comment formatting. I got bored.
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Tadlock committed Sep 7, 2012
1 parent bcdee64 commit 4f241b8
Show file tree
Hide file tree
Showing 14 changed files with 182 additions and 176 deletions.
52 changes: 26 additions & 26 deletions functions/comments.php
Expand Up @@ -4,12 +4,12 @@
* control over their display and makes more filter and action hooks available to developers to use in their
* customizations.
*
* @package HybridCore
* @package HybridCore
* @subpackage Functions
* @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
*/

/* Filter the comment form defaults. */
Expand All @@ -32,10 +32,10 @@ function hybrid_list_comments_args() {

/* Set the default arguments for listing comments. */
$args = array(
'style' => 'ol',
'type' => 'all',
'avatar_size' => 80,
'callback' => 'hybrid_comments_callback',
'style' => 'ol',
'type' => 'all',
'avatar_size' => 80,
'callback' => 'hybrid_comments_callback',
'end-callback' => 'hybrid_comments_end_callback'
);

Expand Down Expand Up @@ -88,12 +88,12 @@ function hybrid_comments_callback( $comment, $args, $depth ) {
$template = locate_template( $templates );

/* Set the template in the comment template array. */
$hybrid->comment_template[$comment_type] = $template;
$hybrid->comment_template[ $comment_type ] = $template;
}

/* If a template was found, load the template. */
if ( !empty( $hybrid->comment_template[$comment_type] ) )
require( $hybrid->comment_template[$comment_type] );
if ( !empty( $hybrid->comment_template[ $comment_type ] ) )
require( $hybrid->comment_template[ $comment_type ] );
}

/**
Expand Down Expand Up @@ -185,24 +185,24 @@ function hybrid_comment_form_args( $args ) {
/* Sets up the default comment form fields. */
$fields = array(
'author' => '<p class="form-author' . esc_attr( $input_class ) . '"><label for="author">' . __( 'Name', 'hybrid-core' ) . $req . '</label> <input type="text" class="text-input" name="author" id="author" value="' . esc_attr( $commenter['comment_author'] ) . '" size="40" /></p>',
'email' => '<p class="form-email' . esc_attr( $input_class ) . '"><label for="email">' . __( 'Email', 'hybrid-core' ) . $req . '</label> <input type="text" class="text-input" name="email" id="email" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="40" /></p>',
'url' => '<p class="form-url"><label for="url">' . __( 'Website', 'hybrid-core' ) . '</label><input type="text" class="text-input" name="url" id="url" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="40" /></p>'
'email' => '<p class="form-email' . esc_attr( $input_class ) . '"><label for="email">' . __( 'Email', 'hybrid-core' ) . $req . '</label> <input type="text" class="text-input" name="email" id="email" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="40" /></p>',
'url' => '<p class="form-url"><label for="url">' . __( 'Website', 'hybrid-core' ) . '</label><input type="text" class="text-input" name="url" id="url" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="40" /></p>'
);

/* Sets the default arguments for displaying the comment form. */
$args = array(
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
'comment_field' => '<p class="form-textarea req"><label for="comment">' . __( 'Comment', 'hybrid-core' ) . '</label><textarea name="comment" id="comment" cols="60" rows="10"></textarea></p>',
'must_log_in' => '<p class="alert">' . sprintf( __( 'You must be <a href="%1$s" title="Log in">logged in</a> to post a comment.', 'hybrid-core' ), wp_login_url( get_permalink() ) ) . '</p><!-- .alert -->',
'logged_in_as' => '<p class="log-in-out">' . sprintf( __( 'Logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'hybrid-core' ), admin_url( 'profile.php' ), esc_attr( $user_identity ) ) . ' <a href="' . wp_logout_url( get_permalink() ) . '" title="' . esc_attr__( 'Log out of this account', 'hybrid-core' ) . '">' . __( 'Log out &raquo;', 'hybrid-core' ) . '</a></p><!-- .log-in-out -->',
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
'comment_field' => '<p class="form-textarea req"><label for="comment">' . __( 'Comment', 'hybrid-core' ) . '</label><textarea name="comment" id="comment" cols="60" rows="10"></textarea></p>',
'must_log_in' => '<p class="alert">' . sprintf( __( 'You must be <a href="%1$s" title="Log in">logged in</a> to post a comment.', 'hybrid-core' ), wp_login_url( get_permalink() ) ) . '</p><!-- .alert -->',
'logged_in_as' => '<p class="log-in-out">' . sprintf( __( 'Logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'hybrid-core' ), admin_url( 'profile.php' ), esc_attr( $user_identity ) ) . ' <a href="' . wp_logout_url( get_permalink() ) . '" title="' . esc_attr__( 'Log out of this account', 'hybrid-core' ) . '">' . __( 'Log out &raquo;', 'hybrid-core' ) . '</a></p><!-- .log-in-out -->',
'comment_notes_before' => '',
'comment_notes_after' => '',
'id_form' => 'commentform',
'id_submit' => 'submit',
'title_reply' => __( 'Leave a Reply', 'hybrid-core' ),
'title_reply_to' => __( 'Leave a Reply to %s', 'hybrid-core' ),
'cancel_reply_link' => __( 'Click here to cancel reply.', 'hybrid-core' ),
'label_submit' => __( 'Post Comment', 'hybrid-core' ),
'comment_notes_after' => '',
'id_form' => 'commentform',
'id_submit' => 'submit',
'title_reply' => __( 'Leave a Reply', 'hybrid-core' ),
'title_reply_to' => __( 'Leave a Reply to %s', 'hybrid-core' ),
'cancel_reply_link' => __( 'Click here to cancel reply.', 'hybrid-core' ),
'label_submit' => __( 'Post Comment', 'hybrid-core' ),
);

/* Return the arguments for displaying the comment form. */
Expand All @@ -214,7 +214,7 @@ function hybrid_comment_form_args( $args ) {
* default, WordPress only allows the 'comment' comment type to have an avatar.
*
* @since 1.2.0
* @access private
* @access public
* @param array $types List of all comment types allowed to have avatars.
* @return array $types
*/
Expand Down
16 changes: 11 additions & 5 deletions functions/context.php
Expand Up @@ -5,12 +5,12 @@
* The functions also integrate with WordPress' implementations of body_class, post_class, and
* comment_class, so your theme won't have any trouble with plugin integration.
*
* @package HybridCore
* @package HybridCore
* @subpackage Functions
* @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
*/

/**
Expand Down Expand Up @@ -86,21 +86,27 @@ function hybrid_get_context() {
/* Date archives. */
if ( is_date() ) {
$hybrid->context[] = 'date';

if ( is_year() )
$hybrid->context[] = 'year';

if ( is_month() )
$hybrid->context[] = 'month';

if ( get_query_var( 'w' ) )
$hybrid->context[] = 'week';

if ( is_day() )
$hybrid->context[] = 'day';
}

/* Time archives. */
if ( is_time() ) {
$hybrid->context[] = 'time';

if ( get_query_var( 'hour' ) )
$hybrid->context[] = 'hour';

if ( get_query_var( 'minute' ) )
$hybrid->context[] = 'minute';
}
Expand Down
22 changes: 11 additions & 11 deletions functions/core-seo.php
Expand Up @@ -4,12 +4,12 @@
* of the functions handle basic <meta> elements for the <head> area of the site. This file is a catchall file
* for adding these types of things to themes.
*
* @package HybridCore
* @package HybridCore
* @subpackage Functions
* @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
*/

/* Add <meta> elements to the <head> area. */
Expand All @@ -25,7 +25,7 @@
* hybrid_meta_robots filter hook at the end.
*
* @since 0.2.3
* @access private
* @access public
* @return void
*/
function hybrid_meta_robots() {
Expand All @@ -45,7 +45,7 @@ function hybrid_meta_robots() {
* archives, it uses the user's display name.
*
* @since 0.3.3
* @access private
* @access public
* @return void
*/
function hybrid_meta_author() {
Expand Down Expand Up @@ -76,7 +76,7 @@ function hybrid_meta_author() {
* published. All other pages will show the current year.
*
* @since 0.4.0
* @access private
* @access public
* @return void
*/
function hybrid_meta_copyright() {
Expand All @@ -99,7 +99,7 @@ function hybrid_meta_copyright() {
* Add the revised meta tag on the singular view of posts. This shows the last time the post was modified.
*
* @since 0.4.0
* @access private
* @access public
* @return void
*/
function hybrid_meta_revised() {
Expand All @@ -118,7 +118,7 @@ function hybrid_meta_revised() {
* Generates the meta description based on either metadata or the description for the object.
*
* @since 0.2.3
* @access private
* @access public
* @return void
*/
function hybrid_meta_description() {
Expand Down Expand Up @@ -187,7 +187,7 @@ function hybrid_meta_description() {
* Generates meta keywords/tags for the site.
*
* @since 0.2.3
* @access private
* @access public
* @return void
*/
function hybrid_meta_keywords() {
Expand Down
34 changes: 17 additions & 17 deletions functions/customize.php
Expand Up @@ -4,12 +4,12 @@
* This file loads additional classes and adds settings to the customizer for the built-in Hybrid Core
* settings.
*
* @package HybridCore
* @package HybridCore
* @subpackage Functions
* @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
*/

/* Load custom control classes. */
Expand Down Expand Up @@ -60,22 +60,22 @@ function hybrid_customize_register( $wp_customize ) {
$wp_customize->add_section(
'hybrid-core-footer',
array(
'title' => esc_html__( 'Footer', 'hybrid-core' ),
'priority' => 200,
'capability' => 'edit_theme_options'
'title' => esc_html__( 'Footer', 'hybrid-core' ),
'priority' => 200,
'capability' => 'edit_theme_options'
)
);

/* Add the 'footer_insert' setting. */
$wp_customize->add_setting(
"{$prefix}_theme_settings[footer_insert]",
array(
'default' => $default_settings['footer_insert'],
'type' => 'option',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'hybrid_customize_sanitize',
'sanitize_js_callback' => 'hybrid_customize_sanitize',
'transport' => 'postMessage',
'default' => $default_settings['footer_insert'],
'type' => 'option',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'hybrid_customize_sanitize',
'sanitize_js_callback' => 'hybrid_customize_sanitize',
'transport' => 'postMessage',
)
);

Expand All @@ -85,9 +85,9 @@ function hybrid_customize_register( $wp_customize ) {
$wp_customize,
'hybrid-core-footer',
array(
'label' => esc_html__( 'Footer', 'hybrid-core' ),
'section' => 'hybrid-core-footer',
'settings' => "{$prefix}_theme_settings[footer_insert]",
'label' => esc_html__( 'Footer', 'hybrid-core' ),
'section' => 'hybrid-core-footer',
'settings' => "{$prefix}_theme_settings[footer_insert]",
)
)
);
Expand Down
10 changes: 5 additions & 5 deletions functions/deprecated.php
Expand Up @@ -6,12 +6,12 @@
* point in a future release. If your theme is using one of these, you should use the listed alternative or
* remove it from your theme if necessary.
*
* @package HybridCore
* @package HybridCore
* @subpackage Functions
* @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
*/

/**
Expand Down
12 changes: 6 additions & 6 deletions functions/i18n.php
Expand Up @@ -4,12 +4,12 @@
* extensions with different textdomains, it must filter 'gettext' so that a single translation file can
* handle all translations.
*
* @package HybridCore
* @package HybridCore
* @subpackage Functions
* @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
*/

/**
Expand All @@ -25,7 +25,7 @@
function hybrid_is_textdomain_loaded( $domain ) {
global $hybrid;

return ( isset( $hybrid->textdomain_loaded[$domain] ) && true === $hybrid->textdomain_loaded[$domain] ) ? true : false;
return ( isset( $hybrid->textdomain_loaded[ $domain ] ) && true === $hybrid->textdomain_loaded[ $domain ] ) ? true : false;
}

/**
Expand Down
10 changes: 5 additions & 5 deletions functions/menus.php
Expand Up @@ -4,12 +4,12 @@
* developers may use the default menu(s) provided by the framework within their own themes, decide not
* to use them, or register additional menus.
*
* @package HybridCore
* @package HybridCore
* @subpackage Functions
* @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
*/

/* Register nav menus. */
Expand Down
10 changes: 5 additions & 5 deletions functions/meta.php
Expand Up @@ -3,12 +3,12 @@
* Metadata functions used in the core framework. This file registers meta keys for use in WordPress
* in a safe manner by setting up a custom sanitize callback.
*
* @package HybridCore
* @package HybridCore
* @subpackage Functions
* @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
*/

/* Register meta on the 'init' hook. */
Expand Down
18 changes: 9 additions & 9 deletions functions/settings.php
Expand Up @@ -5,12 +5,12 @@
* the database. This file is only loaded if the theme adds support for the 'hybrid-core-theme-settings'
* feature.
*
* @package HybridCore
* @package HybridCore
* @subpackage Functions
* @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
*/

/**
Expand Down Expand Up @@ -38,16 +38,16 @@ function hybrid_get_setting( $option = '' ) {
$hybrid->settings = get_option( hybrid_get_prefix() . '_theme_settings', hybrid_get_default_theme_settings() );

/* If the settings isn't an array or the specific option isn't in the array, return false. */
if ( !is_array( $hybrid->settings ) || empty( $hybrid->settings[$option] ) )
if ( !is_array( $hybrid->settings ) || empty( $hybrid->settings[ $option ] ) )
return false;

/* If the specific option is an array, return it. */
if ( is_array( $hybrid->settings[$option] ) )
return $hybrid->settings[$option];
if ( is_array( $hybrid->settings[ $option ] ) )
return $hybrid->settings[ $option ];

/* Strip slashes from the setting and return. */
else
return wp_kses_stripslashes( $hybrid->settings[$option] );
return wp_kses_stripslashes( $hybrid->settings[ $option ] );
}

/**
Expand Down

0 comments on commit 4f241b8

Please sign in to comment.