Skip to content

Commit e41b900

Browse files
committed
some tests for wordpress code formatting / linting in brackets editor
1 parent 5eb059d commit e41b900

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

archive.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,33 @@
66
*/
77

88
get_header();
9-
if (have_posts()) {
9+
if ( have_posts() ) {
1010
?>
1111
<div class="jumbotron">
1212
<div class="container">
1313
<header>
1414
<h1 class="article_title">
1515
<?php
16-
if (is_category()) {
16+
if ( is_category() ) {
1717
printf('%s', single_cat_title('', false));
18-
} elseif (is_tag()) {
18+
} elseif ( is_tag() ) {
1919
echo 'Posts Tagged';
2020
echo '&#8216; ';
2121
single_tag_title();
2222
echo '&#8217;';
23-
} elseif (is_day()) {
23+
} elseif ( is_day() ) {
2424
printf('Archive for %s', get_the_time('F jS, Y'));
25-
} elseif (is_month()) {
25+
} elseif ( is_month() ) {
2626
printf('Archive for %s', get_the_time('F Y'));
27-
} elseif (is_year()) {
27+
} elseif ( is_year() ) {
2828
printf('Archive for %s', get_the_time('Y'));
29-
} elseif (is_search()) {
29+
} elseif ( is_search() ) {
3030
echo 'Search Results';
31-
} elseif (is_author()) {
31+
} elseif ( is_author() ) {
3232
echo 'All entries by this author';
3333
} elseif (isset($_GET['paged']) && ! empty($_GET['paged'])) {
3434
echo 'Blog Archives';
35-
} elseif (is_home()) {
35+
} elseif ( is_home() ) {
3636
echo 'Recent Posts';
3737
}
3838
?>
@@ -43,7 +43,7 @@
4343
<section class="container post">
4444
<?php
4545
$colour = multiloquent_get_random_blue_class();
46-
while (have_posts()) {
46+
while ( have_posts() ) {
4747
the_post();
4848
multiloquent_render_the_archive($colour);
4949
}
@@ -62,7 +62,7 @@
6262
</div>
6363
<?php } else { ?>
6464
<div class="container post">
65-
<?php get_template_part('error-snippet');?>
65+
<?php get_template_part( 'error-snippet' );?>
6666
</div>
6767
<?php
6868
}

function-definitions.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @internal internal
1212
* @return string
1313
*/
14+
1415
function multiloquent_version()
1516
{
1617
$version = '7.1.1';
@@ -30,11 +31,12 @@ function multiloquent_version()
3031
* name of file to include, excluding .php extension
3132
* @global object $post the wordpress post object
3233
*/
33-
function multiloquent_get_template_part($file)
34+
35+
function multiloquent_get_template_part( $file )
3436
{
3537
// needed for the included files...
3638
global $post;
37-
require_once (trailingslashit(get_template_directory()) . $file . '.php');
39+
require_once ( trailingslashit(get_template_directory( ) ) . $file . '.php');
3840
}
3941

4042
/**
@@ -44,14 +46,14 @@ function multiloquent_get_template_part($file)
4446
* @param string $content
4547
* @return string
4648
*/
47-
function multiloquent_featured_image_in_feed($content)
49+
function multiloquent_featured_image_in_feed( $content )
4850
{
4951
global $post;
50-
if (is_feed()) {
51-
if (has_post_thumbnail($post->ID)) {
52-
$output = get_the_post_thumbnail($post->ID, 'medium', array(
53-
'style' => 'float:right; margin:0 0 10px 10px;'
54-
));
52+
if ( is_feed( ) ) {
53+
if ( has_post_thumbnail( $post->ID ) ) {
54+
$output = get_the_post_thumbnail( $post->ID, 'medium', array(
55+
'style' => 'float:right; margin:0 0 10px 10px;',
56+
) );
5557
$content = $output . $content;
5658
}
5759
}

0 commit comments

Comments
 (0)