Skip to content

Commit 2e42455

Browse files
author
Brylie Christopher Oxley
committed
Fix WordPress standard php formatting
1 parent eae6054 commit 2e42455

File tree

9 files changed

+132
-135
lines changed

9 files changed

+132
-135
lines changed

functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @version 2021.07.1
66
* @package creativecommons-base
77
*/
8-
include( get_theme_file_path('inc/theme-customizer.php') );
8+
require get_theme_file_path( 'inc/theme-customizer.php' );
99

1010
/* Theme Constants (to speed up some common things) ------*/
1111
define( 'HOME_URI', get_bloginfo( 'url' ) );
@@ -27,7 +27,7 @@
2727
require TEMPLATEPATH . '/inc/class-walkers.php';
2828
require TEMPLATEPATH . '/inc/helpers.php';
2929

30-
add_action('customize_register', 'cc_base_theme_customize_register');
30+
add_action( 'customize_register', 'cc_base_theme_customize_register' );
3131

3232
/**
3333
* Images

inc/partials/home/home-featured.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
2-
$featured_content_is_enabled = get_theme_mod('cc_base_enable_featured_content');
3-
$announcement_is_enabled = ( get_theme_mod('cc_base_enabled_announcement') ) ? ' has-notification-enabled' : '';
4-
$featured_content = get_theme_mod('cc_base_featured_content');
5-
$featured_image_setting = get_theme_mod('cc_base_featured_content_background_image');
6-
$featured_image = ( ! empty( $featured_image_setting ) ) ? 'style="background-image: url(' . wp_get_attachment_url( $featured_image_setting, 'landscape-featured' ) . ');"' : false;
7-
$featured_background_color_setting = get_theme_mod('cc_base_featured_content_background_color');
8-
$featured_background_color = ( ! empty( $featured_background_color_setting ) ) ? 'has-background-' . $featured_background_color_setting : '';
9-
$include_donate_is_enabled = get_theme_mod('cc_base_include_donate');
2+
$featured_content_is_enabled = get_theme_mod( 'cc_base_enable_featured_content' );
3+
$announcement_is_enabled = ( get_theme_mod( 'cc_base_enabled_announcement' ) ) ? ' has-notification-enabled' : '';
4+
$featured_content = get_theme_mod( 'cc_base_featured_content' );
5+
$featured_image_setting = get_theme_mod( 'cc_base_featured_content_background_image' );
6+
$featured_image = ( ! empty( $featured_image_setting ) ) ? 'style="background-image: url(' . wp_get_attachment_url( $featured_image_setting, 'landscape-featured' ) . ');"' : false;
7+
$featured_background_color_setting = get_theme_mod( 'cc_base_featured_content_background_color' );
8+
$featured_background_color = ( ! empty( $featured_background_color_setting ) ) ? 'has-background-' . $featured_background_color_setting : '';
9+
$include_donate_is_enabled = get_theme_mod( 'cc_base_include_donate' );
1010
?>
1111

1212
<!-- TODO: determine what the following line intends to achieve and clean up semantics to make more self-documenting -->
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<h2><?php the_title(); ?></h2>
22
<?php
3-
$show_authors_is_enabled = get_theme_mod('cc_base_show_authors');
3+
$show_authors_is_enabled = get_theme_mod( 'cc_base_show_authors' );
44

5-
if ($show_authors_is_enabled) {
6-
get_template_part('inc/partials/entry/entry', 'author');
7-
} else {
8-
echo '<span class="entry-date">' . get_the_date(CC_Site::get_date_format()) . '</span>';
9-
}
5+
if ( $show_authors_is_enabled ) {
6+
get_template_part( 'inc/partials/entry/entry', 'author' );
7+
} else {
8+
echo '<span class="entry-date">' . get_the_date( CC_Site::get_date_format() ) . '</span>';
9+
}
1010
?>
1111
<?php
12-
if (function_exists('yoast_breadcrumb')) {
13-
yoast_breadcrumb('<p id="breadcrumbs">', '</p>');
14-
}
12+
if ( function_exists( 'yoast_breadcrumb' ) ) {
13+
yoast_breadcrumb( '<p id="breadcrumbs">', '</p>' );
14+
}
1515
?>
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
2-
$gallery_objects = get_post_meta(get_the_ID(), 'post_gallery', false);
3-
if (! empty($gallery_objects)) {
2+
$gallery_objects = get_post_meta( get_the_ID(), 'post_gallery', false );
3+
if ( ! empty( $gallery_objects ) ) {
44
echo '<div class="glide entry-gallery">';
55
echo '<div class="glide__track" data-glide-el="track">';
66
echo '<ul class="glide__slides">';
7-
foreach ($gallery_objects as $object) {
7+
foreach ( $gallery_objects as $object ) {
88
echo '<li class="glide__slide">';
9-
echo wp_get_attachment_image($object, 'landscape-featured');
9+
echo wp_get_attachment_image( $object, 'landscape-featured' );
1010
echo '</li>';
1111
}
1212
echo '</ul>';
@@ -20,16 +20,16 @@
2020
?>
2121
<h2><?php the_title(); ?></h2>
2222
<?php
23-
$show_authors_is_enabled = get_theme_mod('cc_base_show_authors');
23+
$show_authors_is_enabled = get_theme_mod( 'cc_base_show_authors' );
2424

25-
if ($show_authors_is_enabled) {
26-
get_template_part('inc/partials/entry/entry', 'author');
27-
} else {
28-
echo '<span class="entry-date">' . get_the_date(CC_Site::get_date_format()) . '</span>';
29-
}
25+
if ( $show_authors_is_enabled ) {
26+
get_template_part( 'inc/partials/entry/entry', 'author' );
27+
} else {
28+
echo '<span class="entry-date">' . get_the_date( CC_Site::get_date_format() ) . '</span>';
29+
}
3030
?>
3131
<?php
32-
if (function_exists('yoast_breadcrumb')) {
33-
yoast_breadcrumb('<p id="breadcrumbs">', '</p>');
34-
}
32+
if ( function_exists( 'yoast_breadcrumb' ) ) {
33+
yoast_breadcrumb( '<p id="breadcrumbs">', '</p>' );
34+
}
3535
?>
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<?php
2-
if (has_post_thumbnail()) {
3-
echo '<figure class="entry-image">';
4-
the_post_thumbnail('landscape-featured');
5-
echo '</figure>';
6-
}
2+
if ( has_post_thumbnail() ) {
3+
echo '<figure class="entry-image">';
4+
the_post_thumbnail( 'landscape-featured' );
5+
echo '</figure>';
6+
}
77
?>
88
<h2><?php the_title(); ?></h2>
99

1010
<?php
11-
$show_authors_is_enabled = get_theme_mod('cc_base_show_authors');
11+
$show_authors_is_enabled = get_theme_mod( 'cc_base_show_authors' );
1212

13-
if ($show_authors_is_enabled) {
14-
get_template_part('inc/partials/entry/entry', 'author');
15-
} else {
16-
echo '<span class="entry-date">' . get_the_date(CC_Site::get_date_format()) . '</span>';
17-
}
13+
if ( $show_authors_is_enabled ) {
14+
get_template_part( 'inc/partials/entry/entry', 'author' );
15+
} else {
16+
echo '<span class="entry-date">' . get_the_date( CC_Site::get_date_format() ) . '</span>';
17+
}
1818
?>
1919
<?php
20-
if (function_exists('yoast_breadcrumb')) {
21-
yoast_breadcrumb('<p id="breadcrumbs">', '</p>');
22-
}
20+
if ( function_exists( 'yoast_breadcrumb' ) ) {
21+
yoast_breadcrumb( '<p id="breadcrumbs">', '</p>' );
22+
}
2323
?>
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<?php
2-
$video_url = get_post_meta(get_the_ID(), 'post_video_url', true);
3-
if (! empty($video_url)) {
4-
echo '<figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-' . Videos::get_video_class($video_url) . ' wp-embed-aspect-16-9 wp-has-aspect-ratio">';
5-
echo '<div class="wp-block-embed__wrapper">';
6-
echo Videos::get_video_embed($video_url);
7-
echo '</div>';
8-
echo '</figure>';
9-
}
2+
$video_url = get_post_meta( get_the_ID(), 'post_video_url', true );
3+
if ( ! empty( $video_url ) ) {
4+
echo '<figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-' . Videos::get_video_class( $video_url ) . ' wp-embed-aspect-16-9 wp-has-aspect-ratio">';
5+
echo '<div class="wp-block-embed__wrapper">';
6+
echo Videos::get_video_embed( $video_url );
7+
echo '</div>';
8+
echo '</figure>';
9+
}
1010
?>
1111
<h2><?php the_title(); ?></h2>
1212
<?php
13-
$show_authors_is_enabled = get_theme_mod('cc_base_show_authors');
13+
$show_authors_is_enabled = get_theme_mod( 'cc_base_show_authors' );
1414

15-
if ($show_authors_is_enabled) {
16-
get_template_part('inc/partials/entry/entry', 'author');
17-
} else {
18-
echo '<span class="entry-date">' . get_the_date(CC_Site::get_date_format()) . '</span>';
19-
}
15+
if ( $show_authors_is_enabled ) {
16+
get_template_part( 'inc/partials/entry/entry', 'author' );
17+
} else {
18+
echo '<span class="entry-date">' . get_the_date( CC_Site::get_date_format() ) . '</span>';
19+
}
2020
?>
2121
<?php
22-
if (function_exists('yoast_breadcrumb')) {
23-
yoast_breadcrumb('<p id="breadcrumbs">', '</p>');
24-
}
22+
if ( function_exists( 'yoast_breadcrumb' ) ) {
23+
yoast_breadcrumb( '<p id="breadcrumbs">', '</p>' );
24+
}
2525
?>

0 commit comments

Comments
 (0)