Skip to content

Commit 286ecde

Browse files
committed
Coding Standards
1 parent d0c946a commit 286ecde

13 files changed

+74
-91
lines changed

archive-jetpack-portfolio.php

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
<?php
22
get_header();
33

4-
$layout = get_theme_mod( 'projects_layout_view', 'mansonry' );
4+
$layout = get_theme_mod( 'projects_layout_view', 'mansonry' );
55
$layout_class = shapely_get_layout_class();
66

77
$item_classes = 'post-snippet col-md-3 col-sm-6 project';
88
if ( 'mansonry' == $layout ) {
99
$item_classes .= ' masonry-item';
1010
}
1111

12+
if ( 'sidebar-left' == $layout_class ) :
13+
get_sidebar();
14+
endif;
1215
?>
13-
<?php
14-
if ( 'sidebar-left' == $layout_class ) :
15-
get_sidebar();
16-
endif;
17-
?>
1816
<div id="primary" class="content-area col-md-8 mb-xs-24 <?php echo esc_attr( $layout_class ); ?>">
1917
<main id="main" class="site-main" role="main">
2018

@@ -29,7 +27,7 @@
2927
</div>
3028
</div>
3129
<?php endif ?>
32-
30+
3331
<div class="<?php echo 'mansonry' == $layout ? 'masonry masonryFlyIn' : ''; ?>">
3432
<?php
3533
/* Start the Loop */
@@ -41,35 +39,35 @@
4139
$project_types = wp_get_post_terms( $post->ID, 'jetpack-portfolio-type', $projects_args );
4240

4341
$thumbnail_url = get_the_post_thumbnail_url( get_the_ID(), 'full' );
44-
$item_style = '';
42+
$item_style = '';
4543
if ( 'mansonry' != $layout ) {
4644
$item_style = 'background-image: url(' . $thumbnail_url . ')';
4745
}
48-
?>
46+
?>
4947

5048
<article id="post-<?php the_ID(); ?>" <?php post_class( $item_classes ); ?>>
51-
<div class="image-tile inner-title hover-reveal text-center" style="<?php echo $item_style; ?>">
52-
<?php
53-
if ( has_post_thumbnail() ) {
54-
?>
55-
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
56-
<?php
57-
if ( 'mansonry' == $layout ) {
58-
the_post_thumbnail( 'medium' );
59-
}
49+
<div class="image-tile inner-title hover-reveal text-center" style="<?php echo $item_style; ?>">
50+
<?php
51+
if ( has_post_thumbnail() ) {
6052
?>
61-
<div class="title">
62-
<?php
63-
the_title( '<h5 class="mb0">', '</h5>' );
64-
if ( ! empty( $project_types ) ) {
65-
echo '<span>' . implode( ' / ', $project_types ) . '</span>';
66-
}
67-
?>
68-
</div>
53+
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
54+
<?php
55+
if ( 'mansonry' == $layout ) {
56+
the_post_thumbnail( 'medium' );
57+
}
58+
?>
59+
<div class="title">
60+
<?php
61+
the_title( '<h5 class="mb0">', '</h5>' );
62+
if ( ! empty( $project_types ) ) {
63+
echo '<span>' . implode( ' / ', $project_types ) . '</span>';
64+
}
65+
?>
66+
</div>
6967
</a>
7068
<?php
71-
}
72-
?>
69+
}
70+
?>
7371
</div>
7472
</article><!-- #post-## -->
7573
<?php
@@ -87,10 +85,9 @@
8785

8886
</main><!-- #main -->
8987
</div><!-- #primary -->
90-
<?php
91-
if ( 'sidebar-right' == $layout_class ) :
92-
get_sidebar();
93-
endif;
94-
?>
9588
<?php
89+
if ( 'sidebar-right' == $layout_class ) :
90+
get_sidebar();
91+
endif;
92+
9693
get_footer();

inc/admin/welcome-screen/class-shapely-welcome.php

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct() {
3232
)
3333
);
3434

35-
$theme = wp_get_theme();
35+
$theme = wp_get_theme();
3636
$this->theme_name = $theme->get( 'Name' );
3737
$this->theme_slug = $theme->get( 'TextDomain' );
3838

@@ -109,8 +109,7 @@ public function shapely_welcome_admin_notice() {
109109
?>
110110
<div class="updated notice is-dismissible">
111111
<p><?php echo sprintf( esc_html__( 'Welcome! Thank you for choosing Shapely! To fully take advantage of the best our theme can offer please make sure you visit our %1$swelcome page%2$s.', 'shapely' ), '<a href="' . esc_url( admin_url( 'themes.php?page=shapely-welcome' ) ) . '">', '</a>' ); ?></p>
112-
<p><a href="<?php echo esc_url( admin_url( 'themes.php?page=shapely-welcome' ) ); ?>" class="button"
113-
style="text-decoration: none;"><?php echo esc_html__( 'Get started with Shapely', 'shapely' ); ?></a>
112+
<p><a href="<?php echo esc_url( admin_url( 'themes.php?page=shapely-welcome' ) ); ?>" class="button" style="text-decoration: none;"><?php echo esc_html__( 'Get started with Shapely', 'shapely' ); ?></a>
114113
</p>
115114
</div>
116115
<?php
@@ -289,13 +288,13 @@ public function check_active( $slug ) {
289288

290289
return array(
291290
'status' => is_plugin_active( $slug2 ),
292-
'needs' => $needs,
291+
'needs' => $needs,
293292
);
294293
}
295294

296295
return array(
297296
'status' => false,
298-
'needs' => 'install',
297+
'needs' => 'install',
299298
);
300299
}
301300

@@ -381,15 +380,11 @@ class="about-text"><?php echo esc_html__( 'Shapely is now installed and ready to
381380

382381

383382
<h2 class="nav-tab-wrapper wp-clearfix">
384-
<a href="<?php echo esc_url( admin_url( 'themes.php?page=shapely-welcome&tab=getting_started' ) ); ?>"
385-
class="nav-tab <?php echo 'getting_started' == $active_tab ? 'nav-tab-active' : ''; ?>"><?php echo esc_html__( 'Getting Started', 'shapely' ); ?></a>
386-
<a href="<?php echo esc_url( admin_url( 'themes.php?page=shapely-welcome&tab=recommended_actions' ) ); ?>"
387-
class="nav-tab <?php echo 'recommended_actions' == $active_tab ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Recommended Actions', 'shapely' ); ?>
383+
<a href="<?php echo esc_url( admin_url( 'themes.php?page=shapely-welcome&tab=getting_started' ) ); ?>" class="nav-tab <?php echo 'getting_started' == $active_tab ? 'nav-tab-active' : ''; ?>"><?php echo esc_html__( 'Getting Started', 'shapely' ); ?></a>
384+
<a href="<?php echo esc_url( admin_url( 'themes.php?page=shapely-welcome&tab=recommended_actions' ) ); ?>" class="nav-tab <?php echo 'recommended_actions' == $active_tab ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Recommended Actions', 'shapely' ); ?>
388385
<?php echo $action_count > 0 ? '<span class="badge-action-count">' . esc_html( $action_count ) . '</span>' : ''; ?></a>
389-
<a href="<?php echo esc_url( admin_url( 'themes.php?page=shapely-welcome&tab=recommended_plugins' ) ); ?>"
390-
class="nav-tab <?php echo 'recommended_plugins' == $active_tab ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Recommended Plugins', 'shapely' ); ?></a>
391-
<a href="<?php echo esc_url( admin_url( 'themes.php?page=shapely-welcome&tab=support' ) ); ?>"
392-
class="nav-tab <?php echo 'support' == $active_tab ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Support', 'shapely' ); ?></a>
386+
<a href="<?php echo esc_url( admin_url( 'themes.php?page=shapely-welcome&tab=recommended_plugins' ) ); ?>" class="nav-tab <?php echo 'recommended_plugins' == $active_tab ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Recommended Plugins', 'shapely' ); ?></a>
387+
<a href="<?php echo esc_url( admin_url( 'themes.php?page=shapely-welcome&tab=support' ) ); ?>" class="nav-tab <?php echo 'support' == $active_tab ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Support', 'shapely' ); ?></a>
393388
</h2>
394389

395390
<?php

inc/admin/welcome-screen/sections/getting-started.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
<div class="col">
3535
<h3><?php esc_html_e( 'Step 3 - Customize everything', 'shapely' ); ?></h3>
3636
<p><?php esc_html_e( 'Using the WordPress Customizer you can easily customize every aspect of the theme.', 'shapely' ); ?></p>
37-
<p><a target="_blank" href="<?php echo esc_url( $customizer_url ); ?>"
38-
class="button button-primary"><?php esc_html_e( 'Go to Customizer', 'shapely' ); ?></a>
37+
<p><a target="_blank" href="<?php echo esc_url( $customizer_url ); ?>" class="button button-primary"><?php esc_html_e( 'Go to Customizer', 'shapely' ); ?></a>
3938
</p>
4039
</div><!--/.col-->
4140
</div><!--/.feature-section-->

inc/admin/welcome-screen/sections/support.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
<p>
55
<i><?php esc_html_e( 'We offer excellent support through our advanced ticketing system. Make sure to register your purchase before contacting support!', 'shapely' ); ?></i>
66
</p>
7-
<p><a target="_blank" class="button button-primary"
8-
href="<?php echo esc_url( 'https://colorlib.com/wp/forums/' ); ?>"><?php esc_html_e( 'Contact Support', 'shapely' ); ?></a>
7+
<p><a target="_blank" class="button button-primary" href="<?php echo esc_url( 'https://colorlib.com/wp/forums/' ); ?>"><?php esc_html_e( 'Contact Support', 'shapely' ); ?></a>
98
</p>
109
</div><!--/.col-->
1110

inc/class-shapely-builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function get_all_pages() {
4646
'id' => absint( $post->ID ),
4747
'title' => esc_html( $post->post_title ),
4848
);
49-
$this->sidebars[] = 'shapely-' . $post->post_name;
49+
$this->sidebars[] = 'shapely-' . $post->post_name;
5050
}
5151
}
5252

inc/class-shapely-related-posts.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,7 @@ function output_related_posts() {
235235
echo '<div class="shapely-related-post-title">';
236236

237237
# Post Title
238-
echo '<a href="' . esc_url( get_the_permalink() ) . '">' . wp_trim_words( get_the_title(), 5 ) .
239-
'</a>';
240-
238+
echo '<a href="' . esc_url( get_the_permalink() ) . '">' . wp_trim_words( get_the_title(), 5 ) . '</a>';
241239
echo '</div>';
242240

243241
}

inc/extras.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,7 @@ function shapely_footer_callout() {
731731
<h3 class="cfa-text"><?php echo wp_kses_post( get_theme_mod( 'footer_callout_text' ) ); ?></h3>
732732
</div>
733733
<div class="col-sm-3">
734-
<a href='<?php echo esc_url( get_theme_mod( 'footer_callout_link' ) ); ?>'
735-
class="mb0 btn btn-lg btn-filled cfa-button">
734+
<a href='<?php echo esc_url( get_theme_mod( 'footer_callout_link' ) ); ?>' class="mb0 btn btn-lg btn-filled cfa-button">
736735
<?php echo wp_kses_post( get_theme_mod( 'footer_callout_btntext' ) ); ?>
737736
</a>
738737
</div>

inc/template-tags.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,9 @@ function shapely_posted_on_no_cat() {
7272
<?php if ( $post_date ) : ?>
7373
<li><span class="posted-on"><?php echo $time_string; ?></span></li>
7474
<?php endif ?>
75-
7675
<?php if ( $post_author ) : ?>
7776
<li><span><?php echo esc_html__( 'by', 'shapely' ); ?> <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php echo esc_attr( get_the_author() ); ?>"><?php esc_html( the_author() ); ?></a></span></li>
7877
<?php endif ?>
79-
8078
</ul>
8179
<?php
8280
endif;

template-parts/content-grid-small.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<article id="post-<?php the_ID(); ?>" <?php post_class( 'post-content post-grid-small col-md-6' ); ?> >
1212
<header class="entry-header nolist">
1313
<?php
14-
$category = get_the_category();
14+
$category = get_the_category();
1515
$show_category = true;
1616
if ( is_category() ) {
1717
$show_category = get_theme_mod( 'show_category_on_category_page', 1 );
1818
}
19-
$image = '<img class="wp-post-image" alt="" src="' . get_template_directory_uri() . '/assets/images/placeholder.jpg" />';
19+
$image = '<img class="wp-post-image" alt="" src="' . get_template_directory_uri() . '/assets/images/placeholder.jpg" />';
2020
if ( has_post_thumbnail() ) {
2121
$image = get_the_post_thumbnail( get_the_ID(), 'shapely-grid' );
2222
}
@@ -63,13 +63,13 @@
6363
the_content(
6464
sprintf(
6565
/* translators: %s: Name of current post. */
66-
wp_kses(
67-
__( 'Read more %s <span class="meta-nav">&rarr;</span>', 'shapely' ), array(
68-
'span' => array(
69-
'class' => array(),
70-
),
71-
)
72-
),
66+
wp_kses(
67+
__( 'Read more %s <span class="meta-nav">&rarr;</span>', 'shapely' ), array(
68+
'span' => array(
69+
'class' => array(),
70+
),
71+
)
72+
),
7373
the_title( '<span class="screen-reader-text">"', '"</span>', false )
7474
)
7575
);

template-parts/content-grid-wide.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
<article id="post-<?php the_ID(); ?>" <?php post_class( 'post-content post-grid-wide col-md-12' ); ?>>
1313
<header class="entry-header nolist">
1414
<?php
15-
$category = get_the_category();
15+
$category = get_the_category();
1616
$show_category = true;
1717
if ( is_category() ) {
1818
$show_category = get_theme_mod( 'show_category_on_category_page', 1 );
1919
}
20-
$image = '<img class="wp-post-image" alt="" src="' . get_template_directory_uri() . '/assets/images/placeholder_wide.jpg" />';
20+
$image = '<img class="wp-post-image" alt="" src="' . get_template_directory_uri() . '/assets/images/placeholder_wide.jpg" />';
2121
if ( has_post_thumbnail() ) {
2222
$layout = shapely_get_layout_class();
2323
$size = 'shapely-featured';
@@ -70,13 +70,13 @@
7070
the_content(
7171
sprintf(
7272
/* translators: %s: Name of current post. */
73-
wp_kses(
74-
__( 'Read more %s <span class="meta-nav">&rarr;</span>', 'shapely' ), array(
75-
'span' => array(
76-
'class' => array(),
77-
),
78-
)
79-
),
73+
wp_kses(
74+
__( 'Read more %s <span class="meta-nav">&rarr;</span>', 'shapely' ), array(
75+
'span' => array(
76+
'class' => array(),
77+
),
78+
)
79+
),
8080
the_title( '<span class="screen-reader-text">"', '"</span>', false )
8181
)
8282
);

0 commit comments

Comments
 (0)