Permalink
Browse files

Coding Standards:

 * Fix non-conformist whitespaces.
 * echo over print.
 * Remove all <br>s
  • Loading branch information...
1 parent 8ecae7a commit 14900ed9ae942b670d6258a77bc443e31fe5bc86 @mfields committed Nov 9, 2011
View
@@ -33,19 +33,19 @@ static public function sections() {
}
static public function template() {
- print "\n" . '<div class="wrap">';
+ echo "\n" . '<div class="wrap">';
screen_icon();
- print "\n" . '<h2>Nighthawk</h2>';
- print "\n" . '<div id="nighthawk">';
+ echo "\n" . '<h2>Nighthawk</h2>';
+ echo "\n" . '<div id="nighthawk">';
do_settings_sections( 'nighthawk' );
- print "\n" . '</div></div>';
+ echo "\n" . '</div></div>';
}
static public function intro() {
- print '<p>This is some stuff about Nighthawk!</p>';
+ echo '<p>This is some stuff about Nighthawk!</p>';
}
static public function plugins() {
@@ -35,7 +35,7 @@
printf( _n( 'There is %1$s bookmark in this section.', 'There are %1$s bookmarks in this section.', $total, 'nighthawk' ), number_format_i18n( $total ) );
- print ' <span class="subscribe"><a href="' . esc_url( get_post_type_archive_feed_link( $nighthawk_post_type ) ) . '" title="' . esc_attr( __( 'Get updated whenever a new bookmark is published.', 'nighthawk' ) ) . '">' . esc_html__( 'Subscribe', 'nighthawk' ) . '</a></span>';
+ echo ' <span class="subscribe"><a href="' . esc_url( get_post_type_archive_feed_link( $nighthawk_post_type ) ) . '" title="' . esc_attr( __( 'Get updated whenever a new bookmark is published.', 'nighthawk' ) ) . '">' . esc_html__( 'Subscribe', 'nighthawk' ) . '</a></span>';
?></div>
View
@@ -31,14 +31,14 @@
}
if ( ! empty( $url ) ) {
- print '<a href="' . esc_url( $url ) . '">' . esc_html( $title ) . '</a>';
+ echo '<a href="' . esc_url( $url ) . '">' . esc_html( $title ) . '</a>';
}
else {
- print esc_html( $title );
+ echo esc_html( $title );
}
?></h1>
- <?php nighthawk_summary_meta( '<div id="intro-meta">', '</div>' ) ?>
+ <?php nighthawk_summary_meta( '<div id="intro-meta">', '</div>' ); ?>
</header>
<div id="content" class="contain">
View
@@ -20,16 +20,16 @@
the_post();
-print '<header id="intro" class="vcard">';
+echo '<header id="intro" class="vcard">';
-print '<h1 id="document-title" class="url fn n">' . esc_html( get_the_author() ) . '</h1>';
+echo '<h1 id="document-title" class="url fn n">' . esc_html( get_the_author() ) . '</h1>';
$bio = get_the_author_meta( 'description' );
if ( ! empty( $bio ) ) {
- print '<div id="summary">' . $bio . '</div>';
+ echo '<div id="summary">' . $bio . '</div>';
}
-print '</header>';
+echo '</header>';
rewind_posts();
View
@@ -27,12 +27,12 @@
}
?>
-<h2><?php esc_html_e( 'About the Author', 'nighthawk' ) ?></h2>
+<h2><?php esc_html_e( 'About the Author', 'nighthawk' ); ?></h2>
<div class="biography box has-avatar contain">
- <div class="avatar"><?php print get_avatar( get_the_author_meta( 'user_email' ), 75 ); ?></div>
- <span class="heading fn author"><?php print esc_html( get_the_author() ); ?></span>
- <span class="meta"><a href="<?php print esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php
+ <div class="avatar"><?php echo get_avatar( get_the_author_meta( 'user_email' ), 75 ); ?></div>
+ <span class="heading fn author"><?php echo esc_html( get_the_author() ); ?></span>
+ <span class="meta"><a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php
printf( esc_html__( 'View all entries by %1$s', 'nighthawk' ), esc_html( get_the_author() ) );
?></a></span>
- <div class="content"><?php print $description; ?></div>
+ <div class="content"><?php echo $description; ?></div>
</div><!--author-box-->
View
@@ -20,16 +20,16 @@
?>
<header id="intro">
- <?php print apply_filters( 'taxonomy-images-queried-term-image', '', array(
+ <?php echo apply_filters( 'taxonomy-images-queried-term-image', '', array(
'size' => 'post-thumbnail',
'before' => '<div id="featured-image">',
'after' => '</div>',
) ); ?>
<h1 id="document-title"><?php single_cat_title(); ?></h1>
- <div id="summary"><?php print category_description(); ?></div>
+ <div id="summary"><?php echo category_description(); ?></div>
<div id="intro-meta">
<?php printf( _n( 'There is %1$s entry in this category.', 'There are %1$s entries in this category.', (int) $wp_query->found_posts, 'nighthawk' ), number_format_i18n( (int) $wp_query->found_posts ) ); ?>
- <span class="subscribe"> <a href="<?php print esc_url( get_category_feed_link( $wp_query->get_queried_object_id() ) ) ?>" title="<?php printf( esc_attr__( 'Get updated whenever a new entry is added to the %1$s category.', 'nighthawk' ), single_cat_title( '', false ) ); ?>"><?php esc_html_e( 'Subscribe', 'nighthawk' ) ?></a></span>
+ <span class="subscribe"> <a href="<?php echo esc_url( get_category_feed_link( $wp_query->get_queried_object_id() ) ); ?>" title="<?php printf( esc_attr__( 'Get updated whenever a new entry is added to the %1$s category.', 'nighthawk' ), single_cat_title( '', false ) ); ?>"><?php esc_html_e( 'Subscribe', 'nighthawk' ); ?></a></span>
</div>
</header>
View
@@ -25,7 +25,7 @@
*/
if ( post_password_required() ) {
if ( have_comments() )
- print '<p class="nopassword">' . sprintf( __( 'This %1$s is password protected. Enter the password to view any comments.', 'nighthawk' ), nighthawk_post_label_singular() ) . '</p>';
+ echo '<p class="nopassword">' . sprintf( __( 'This %1$s is password protected. Enter the password to view any comments.', 'nighthawk' ), nighthawk_post_label_singular() ) . '</p>';
return;
}
@@ -58,23 +58,23 @@
}
/* Print heading. */
- print '<h2 id="comments">' . $heading . ' ' . $addendum . '</h2>';
+ echo '<h2 id="comments">' . $heading . ' ' . $addendum . '</h2>';
/* List the comments. */
- print '<ol class="comment-list">';
+ echo '<ol class="comment-list">';
wp_list_comments( apply_filters( 'nighthawk_list_comments_args', array(
'callback' => '_nighthawk_comment_start',
'end-callback' => '_nighthawk_comment_end',
'max-depth' => 1
) ) );
- print '</ol>';
+ echo '</ol>';
/* Paged navigation. */
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) {
- print '<div class="navigation">';
- print '<div class="nav-previous">'; previous_comments_link( __( '&laquo; Older Comments', 'nighthawk' ) ); print '</div>';
- print '<div class="nav-next">'; next_comments_link( __( 'Newer Comments &raquo;', 'nighthawk' ) ); print '</div>';
- print '</div>';
+ echo '<div class="navigation">';
+ echo '<div class="nav-previous">'; previous_comments_link( __( '&laquo; Older Comments', 'nighthawk' ) ); echo '</div>';
+ echo '<div class="nav-next">'; next_comments_link( __( 'Newer Comments &raquo;', 'nighthawk' ) ); echo '</div>';
+ echo '</div>';
}
}
View
@@ -43,7 +43,7 @@
}
?>
- <?php print '<div id="intro-meta">' . $meta . '</div>'; ?>
+ <?php echo '<div id="intro-meta">' . $meta . '</div>'; ?>
</header>
<div id="content" class="contain">
View
@@ -24,45 +24,45 @@
else {
$avatar = '<span class="image">' . $avatar . '</span>';
}
- print $avatar;
- print "\n" . '<div class="content">';
+ echo $avatar;
+ echo "\n" . '<div class="content">';
the_content();
- print "\n" . '</div><!--content-->';
+ echo "\n" . '</div><!--content-->';
- print '<div class="entry-meta">';
+ echo '<div class="entry-meta">';
nighthawk_entry_meta_taxonomy();
- print '</div><!--meta-->';
+ echo '</div><!--meta-->';
- /*print '<a href="' . esc_url( get_permalink() . '#respond' ) . '" class="comment-icon" title="' . esc_attr__( 'Add a comment', 'nighthawk' ) . '"><img src="' . get_template_directory_uri() . '/images/comment.png" alt="" /></a>';*/
+ /*echo '<a href="' . esc_url( get_permalink() . '#respond' ) . '" class="comment-icon" title="' . esc_attr__( 'Add a comment', 'nighthawk' ) . '"><img src="' . get_template_directory_uri() . '/images/comment.png" alt="" /></a>';*/
break;
case 'image' :
the_content();
the_title( '<h2 style="text-align:center">', '</h2>' );
- print '<div class="entry-meta">';
- print esc_html( get_the_date() );
- print '</div><!--meta-->';
+ echo '<div class="entry-meta">';
+ echo esc_html( get_the_date() );
+ echo '</div><!--meta-->';
break;
default :
$featured_image = get_the_post_thumbnail();
if ( ! empty( $featured_image ) ) {
- print "\n" . '<div class="featured-image">';
- print '<a href="' . esc_url( get_permalink() ) . '">' . $featured_image . '</a>';
- print '</div>';
+ echo "\n" . '<div class="featured-image">';
+ echo '<a href="' . esc_url( get_permalink() ) . '">' . $featured_image . '</a>';
+ echo '</div>';
}
if ( ! is_singular() ) {
the_title( "\n" . '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '">', '</a></h2>' );
}
- print "\n" . '<div class="entry-content">';
+ echo "\n" . '<div class="entry-content">';
the_content( __( 'Continue Reading', 'nighthawk' ) );
- print "\n" . '</div><!--entry-content-->';
+ echo "\n" . '</div><!--entry-content-->';
wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'nighthawk' ), 'after' => '</div>' ) );
- print '<div class="entry-meta">';
+ echo '<div class="entry-meta">';
nighthawk_entry_meta_taxonomy();
- print '</div><!--meta-->';
+ echo '</div><!--meta-->';
break;
}
View
@@ -28,19 +28,19 @@
/* Content. */
if ( post_type_supports( $nighthawk_post_type, 'editor' ) ) {
- print "\n" . '<div class="entry-content">';
+ echo "\n" . '<div class="entry-content">';
the_content( __( 'Continue Reading', 'nighthawk' ) );
- print "\n" . '</div><!--entry-content-->';
+ echo "\n" . '</div><!--entry-content-->';
wp_link_pages( array(
'after' => '</div>',
'before' => '<div class="page-link">' . __( 'Pages:', 'nighthawk' ),
) );
}
/* Excerpt - Attempt to display excerpt only if the post_type does not support content. */
else if ( post_type_supports( $nighthawk_post_type, 'excerpt' ) ) {
- print "\n" . '<div class="entry-content">';
+ echo "\n" . '<div class="entry-content">';
the_excerpt();
- print "\n" . '</div><!--entry-content-->';
+ echo "\n" . '</div><!--entry-content-->';
}
do_action( 'nighthawk_entry_end' );
View
@@ -3,13 +3,13 @@
* Alternative Footer Template.
*
* Just like footer.php with the following things omitted:
- *
+ *
* Paged navigation.
* Widgetized areas.
* Secondary theme location for nav menu.
*
* This file should close any html tags opened in header-no-nav.php.
- *
+ *
* @package Nighthawk
* @author Michael Fields <michael@mfields.org>
* @copyright Copyright (c) 2011, Michael Fields
@@ -28,7 +28,7 @@
<script>
var imgs, i, w;
var imgs = document.getElementsByTagName( 'img' );
-for( i = 0; i < imgs.length; i++ ) {
+for ( i = 0; i < imgs.length; i++ ) {
w = imgs[i].getAttribute( 'width' );
if ( 615 < w ) {
imgs[i].removeAttribute( 'width' );
View
@@ -25,7 +25,7 @@
*/
?>
- <?php do_action( 'nighthawk_append_to_page_div' ) ?>
+ <?php do_action( 'nighthawk_append_to_page_div' ); ?>
</div><!-- #page -->
@@ -43,14 +43,14 @@
}
$count = count( $active );
if ( 0 < $count ) {
- print '<div id="widgets" class="count-' . $count . '" role="complementary">';
+ echo '<div id="widgets" class="count-' . $count . '" role="complementary">';
foreach ( $active as $order => $area ) {
- print '<div id="' . esc_attr( $area ) . '" class="area area-' . ( 1 + $order ) . '">' . "\n";
+ echo '<div id="' . esc_attr( $area ) . '" class="area area-' . ( 1 + $order ) . '">' . "\n";
dynamic_sidebar( $area . '-footer-widget-area' );
- print '</div>' . "\n";
+ echo '</div>' . "\n";
}
- print '<div class="clear"></div>';
- print '</div><!-- #footer-widget-area -->';
+ echo '<div class="clear"></div>';
+ echo '</div><!-- #footer-widget-area -->';
}
?>
View
@@ -52,7 +52,7 @@
$class = ' class="has-featured-image"';
}
- print "\n" . '<header id="intro"' . $class . '>';
+ echo "\n" . '<header id="intro"' . $class . '>';
$title = __( 'Featured', 'nighthawk' );
@@ -61,24 +61,24 @@
$title = $post_title;
}
- print "\n" . '<h1 id="document-title"><a href="' . esc_url( get_permalink() ) . '">' . $title . '</a></h1>';
+ echo "\n" . '<h1 id="document-title"><a href="' . esc_url( get_permalink() ) . '">' . $title . '</a></h1>';
if ( ! empty( $featured_image ) ) {
- print "\n" . '<div id="featured-image">';
- print '<a href="' . esc_url( get_permalink() ) . '">' . $featured_image . '</a>';
- print '</div>';
+ echo "\n" . '<div id="featured-image">';
+ echo '<a href="' . esc_url( get_permalink() ) . '">' . $featured_image . '</a>';
+ echo '</div>';
}
- print "\n" . '<div id="summary">';
+ echo "\n" . '<div id="summary">';
the_content( __( 'Continue Reading', 'nighthawk' ) );
- print "\n" . '</div>';
+ echo "\n" . '</div>';
wp_link_pages( array(
'before' => '<div class="page-link contain">',
'after' => '</div>'
) );
- print "\n" . '</header>';
+ echo "\n" . '</header>';
}
/*
@@ -88,12 +88,12 @@
* displayed in a custom list under the intro.
*/
if ( ! empty( $stickies ) ) {
- print "\n\n" . '<ul id="intro-list">';
+ echo "\n\n" . '<ul id="intro-list">';
foreach ( $stickies as $i => $post ) {
setup_postdata( $post );
the_title( '<li><a href="' . esc_url( get_permalink() ) . '">', '</a></li>' );
}
- print "\n" . '</ul>';
+ echo "\n" . '</ul>';
}
wp_reset_postdata();
Oops, something went wrong.

0 comments on commit 14900ed

Please sign in to comment.