Skip to content

Commit

Permalink
Fix coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigo-brito committed Jun 27, 2016
1 parent 19802ad commit 2e786fb
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion assets/css/editor-style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/style.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions assets/sass/odin/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ button {
@extend .btn-default;
}

select {
max-width: 100%;
}

.form-radio-group .radio {
&:first-child {
margin-top: 0;
Expand Down
2 changes: 1 addition & 1 deletion audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<?php if ( ! empty( $post->post_parent ) ) : ?>
<ul class="pager page-title">
<li class="previous"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php echo esc_attr( sprintf( __( 'Back to %s', 'odin' ), strip_tags( get_the_title( $post->post_parent ) ) ) ); ?>"><?php printf( __( '<span class="meta-nav">&larr;</span> %s', 'odin' ), get_the_title( $post->post_parent ) ); ?></a></li>
<li class="previous"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'Back to %s', 'odin' ), strip_tags( get_the_title( $post->post_parent ) ) ) ); ?>"><?php printf( __( '<span class="meta-nav">&larr;</span> %s', 'odin' ), get_the_title( $post->post_parent ) ); ?></a></li>
</ul><!-- .pager -->
<?php endif; ?>
</div><!-- .entry-content -->
Expand Down
12 changes: 6 additions & 6 deletions core/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ function odin_related_posts( $display = 'category', $qty = 4, $title = '', $thum
$image = apply_filters( 'odin_related_posts_thumbnail', $img );

$layout .= '<span class="thumb">';
$layout .= sprintf( '<a href="%s" title="%s" class="thumbnail">%s</a>', get_permalink(), get_the_title(), $image );
$layout .= sprintf( '<a href="%s" title="%s" class="thumbnail">%s</a>', esc_url( get_permalink() ), get_the_title(), $image );
$layout .= '</span>';
}

$layout .= '<span class="text">';
$layout .= sprintf( '<a href="%1$s" title="%2$s">%2$s</a>', get_permalink(), get_the_title() );
$layout .= sprintf( '<a href="%1$s" title="%2$s">%2$s</a>', esc_url( get_permalink() ), get_the_title() );
$layout .= '</span>';

$layout .= ( $thumb ) ? '</div>' : '</li>';
Expand Down Expand Up @@ -250,7 +250,7 @@ function odin_breadcrumbs( $homepage = '' ) {
if ( 'product' === $post->post_type ) {
if ( is_woocommerce_activated() ) {
$shop_page = get_post( wc_get_page_id( 'shop' ) );
echo '<li><a href="' . get_permalink( $shop_page ) . '">' . get_the_title( $shop_page ) . '</a></li>';
echo '<li><a href="' . esc_url( get_permalink( $shop_page ) ) . '">' . get_the_title( $shop_page ) . '</a></li>';
}

// Gets post type taxonomies.
Expand Down Expand Up @@ -313,7 +313,7 @@ function odin_breadcrumbs( $homepage = '' ) {

echo '<li><a href="' . get_category_link( $category->term_id ) . '">' . $category->name . '</a></li>';

echo '<li><a href="' . get_permalink( $parent ) . '">' . $parent->post_title . '</a></li>';
echo '<li><a href="' . esc_url( get_permalink( $parent ) ) . '">' . $parent->post_title . '</a></li>';

echo $current_before . get_the_title() . $current_after;

Expand All @@ -329,7 +329,7 @@ function odin_breadcrumbs( $homepage = '' ) {
while ( $parent_id ) {
$page = get_page( $parent_id );

$breadcrumbs[] = '<li><a href="' . get_permalink( $page->ID ) . '">' . get_the_title( $page->ID ) . '</a></li>';
$breadcrumbs[] = '<li><a href="' . esc_url( get_permalink( $page->ID ) ) . '">' . get_the_title( $page->ID ) . '</a></li>';
$parent_id = $page->post_parent;
}

Expand Down Expand Up @@ -412,7 +412,7 @@ function odin_breadcrumbs( $homepage = '' ) {
// Get correct Woocommerce Post Type crumb
if ( is_woocommerce() ) {
$shop_page = get_post( wc_get_page_id( 'shop' ) );
echo '<li><a href="' . get_permalink( $shop_page ) . '">' . get_the_title( $shop_page ) . '</a></li>';
echo '<li><a href="' . esc_url( get_permalink( $shop_page ) ) . '">' . get_the_title( $shop_page ) . '</a></li>';
} else {
$_post_type = array_shift( $taxonomy->object_type );
$post_type = get_post_type_object( $_post_type );
Expand Down
2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<footer id="footer" role="contentinfo">
<div class="container">
<p>&copy; <?php echo date( 'Y' ); ?> <a href="<?php echo home_url(); ?>"><?php bloginfo( 'name' ); ?></a> - <?php _e( 'All rights reserved', 'odin' ); ?> | <?php echo sprintf( __( 'Powered by the <a href="%s" rel="nofollow" target="_blank">Odin</a> forces and <a href="%s" rel="nofollow" target="_blank">WordPress</a>.', 'odin' ), 'http://wpod.in/', 'http://wordpress.org/' ); ?></p>
<p>&copy; <?php echo date( 'Y' ); ?> <a href="<?php echo esc_url( home_url() ); ?>"><?php bloginfo( 'name' ); ?></a> - <?php _e( 'All rights reserved', 'odin' ); ?> | <?php echo sprintf( __( 'Powered by the <a href="%s" rel="nofollow" target="_blank">Odin</a> forces and <a href="%s" rel="nofollow" target="_blank">WordPress</a>.', 'odin' ), 'http://wpod.in/', 'http://wordpress.org/' ); ?></p>
</div><!-- .container -->
</footer><!-- #footer -->

Expand Down
4 changes: 4 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ function odin_enqueue_scripts() {
// jQuery.
wp_enqueue_script( 'jquery' );

// Html5Shiv
wp_enqueue_script( 'html5shiv', $template_url . '/assets/js/html5.js' );
wp_script_add_data( 'html5shiv', 'conditional', 'lt IE 9' );

// General scripts.
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
// Bootstrap.
Expand Down
3 changes: 0 additions & 3 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
<?php if ( ! get_option( 'site_icon' ) ) : ?>
<link href="<?php echo get_template_directory_uri(); ?>/assets/images/favicon.ico" rel="shortcut icon" />
<?php endif; ?>
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/assets/js/html5.js"></script>
<![endif]-->
<?php wp_head(); ?>
</head>

Expand Down
2 changes: 1 addition & 1 deletion image.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<?php if ( ! empty( $post->post_parent ) ) : ?>
<ul class="pager page-title">
<li class="previous"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php echo esc_attr( sprintf( __( 'Back to %s', 'odin' ), strip_tags( get_the_title( $post->post_parent ) ) ) ); ?>" rel="gallery"><?php printf( __( '<span class="meta-nav">&larr;</span> %s', 'odin' ), get_the_title( $post->post_parent ) ); ?></a></li>
<li class="previous"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'Back to %s', 'odin' ), strip_tags( get_the_title( $post->post_parent ) ) ) ); ?>" rel="gallery"><?php printf( __( '<span class="meta-nav">&larr;</span> %s', 'odin' ), get_the_title( $post->post_parent ) ); ?></a></li>
</ul><!-- .pager -->
<?php endif; ?>
</div><!-- .entry-content -->
Expand Down
2 changes: 1 addition & 1 deletion searchform.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<form method="get" id="searchform" class="form-inline" action="<?php echo esc_url( home_url( '/' ) ); ?>" role="search">
<div class="input-group">
<input type="search" class="form-control" name="s" id="s" value="<?php echo get_search_query(); ?>" placeholder="<?php _e( 'Search', 'odin' ); ?>" />
<input type="search" class="form-control" name="s" id="s" value="<?php echo get_search_query(); ?>" placeholder="<?php esc_attr_e( 'Search', 'odin' ); ?>" />
<span class="input-group-btn">
<button type="submit" class="btn btn-default" value="<?php esc_attr_e( 'Search', 'odin' ); ?>">
<i class="glyphicon glyphicon-search"></i>
Expand Down
2 changes: 1 addition & 1 deletion video.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<?php if ( ! empty( $post->post_parent ) ) : ?>
<ul class="pager page-title">
<li class="previous"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php echo esc_attr( sprintf( __( 'Back to %s', 'odin' ), strip_tags( get_the_title( $post->post_parent ) ) ) ); ?>"><?php printf( __( '<span class="meta-nav">&larr;</span> %s', 'odin' ), get_the_title( $post->post_parent ) ); ?></a></li>
<li class="previous"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'Back to %s', 'odin' ), strip_tags( get_the_title( $post->post_parent ) ) ) ); ?>"><?php printf( __( '<span class="meta-nav">&larr;</span> %s', 'odin' ), get_the_title( $post->post_parent ) ); ?></a></li>
</ul><!-- .pager -->
<?php endif; ?>
</div><!-- .entry-content -->
Expand Down

0 comments on commit 2e786fb

Please sign in to comment.