style: PHPCS clean across theme PHP

This commit is contained in:
Keith Solomon
2026-08-16 13:37:49 -05:00
parent aaef1ee4f8
commit 6dcd1233be
5 changed files with 30 additions and 25 deletions
+6 -3
View File
@@ -31,9 +31,11 @@ $footerNav = ! empty( $locations['footer_navigation'] )
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php if ( $footerLogo ) { ?>
<img src="<?php echo esc_url( $footerLogo ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" />
<?php } else {
<?php
} else {
echo esc_html( get_bloginfo( 'name' ) );
} ?>
}
?>
</a>
</h2>
<?php if ( $footerDesc ) : ?>
@@ -41,7 +43,8 @@ $footerNav = ! empty( $locations['footer_navigation'] )
<?php endif; ?>
</div>
<?php for ( $i = 1; $i <= 3; $i++ ) :
<?php
for ( $i = 1; $i <= 3; $i++ ) :
$area_id = 'footer-' . $i;
if ( ! is_active_sidebar( $area_id ) ) {
continue;
+3 -2
View File
@@ -11,7 +11,7 @@ get_header();
$hero_heading = get_field( 'homepage_hero_heading' );
$hero_intro = get_field( 'homepage_hero_intro' );
$hero_cta_1 = get_field( 'homepage_hero_cta_1' ); // array( url, title, target )
$hero_cta_1 = get_field( 'homepage_hero_cta_1' ); // ACF link fields return shape: URL, title, target.
$hero_cta_2 = get_field( 'homepage_hero_cta_2' );
?>
<section class="home-hero aura-bg">
@@ -60,7 +60,8 @@ $hero_cta_2 = get_field( 'homepage_hero_cta_2' );
)
);
if ( $recent->have_posts() ) : ?>
if ( $recent->have_posts() ) :
?>
<div class="home-recent__grid grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<?php
while ( $recent->have_posts() ) :
+2 -2
View File
@@ -10,13 +10,13 @@ namespace KsPortfolio;
get_header();
$queried = get_queried_object();
$title = $queried && ! is_wp_error( $queried ) ? $queried->name : __( 'Projects', 'ks-portfolio' );
$term_name = $queried && ! is_wp_error( $queried ) ? $queried->name : __( 'Projects', 'ks-portfolio' );
?>
<section class="archive-projects aura-bg">
<div class="aura-bg__content">
<div class="container mx-auto my-section">
<header class="archive-projects__head">
<h1 class="archive-projects__title"><?php echo esc_html( $title ); ?></h1>
<h1 class="archive-projects__title"><?php echo esc_html( $term_name ); ?></h1>
<p class="archive-projects__intro">
<a class="archive-projects__back-link" href="<?php echo esc_url( get_post_type_archive_link( 'projects' ) ); ?>">
<?php echo esc_html__( '&larr; All Projects', 'ks-portfolio' ); ?>
+12 -12
View File
@@ -14,34 +14,34 @@ if ( ! isset( $post ) || ! ( $post instanceof \WP_Post ) ) {
return;
}
$post_id = (int) $post->ID;
$project_id = (int) $post->ID;
$type_label = '';
$type_terms = get_the_terms( $post_id, 'project-type' );
$type_terms = get_the_terms( $project_id, 'project-type' );
if ( ! empty( $type_terms ) && ! is_wp_error( $type_terms ) ) {
$type_label = strtoupper( $type_terms[0]->name );
}
$release_url = Projects::get_release_url( $post_id );
$repo_url = Projects::get_repo_browse_url( $post_id );
$repo_data = Projects::get_repo_data( $post_id );
$release_url = Projects::get_release_url( $project_id );
$repo_url = Projects::get_repo_browse_url( $project_id );
$repo_data = Projects::get_repo_data( $project_id );
$language = is_array( $repo_data ) && ! empty( $repo_data['language'] ) ? (string) $repo_data['language'] : '';
$stars = is_array( $repo_data ) && isset( $repo_data['stargazers_count'] ) ? (int) $repo_data['stargazers_count'] : 0;
$excerpt = has_excerpt( $post_id ) ? get_the_excerpt( $post_id ) : wp_trim_words( wp_strip_all_tags( $post->post_content ), 30, '…' );
$excerpt = has_excerpt( $project_id ) ? get_the_excerpt( $project_id ) : wp_trim_words( wp_strip_all_tags( $post->post_content ), 30, '…' );
$card_classes = 'project-card group';
?>
<article class="<?php echo esc_attr( $card_classes ); ?>" aria-labelledby="project-<?php echo esc_attr( (string) $post_id ); ?>-title">
<article class="<?php echo esc_attr( $card_classes ); ?>" aria-labelledby="project-<?php echo esc_attr( (string) $project_id ); ?>-title">
<header class="project-card__head">
<?php if ( $type_label ) : ?>
<span class="project-card__type"><?php echo esc_html( $type_label ); ?></span>
<?php endif; ?>
<span class="project-card__provider" aria-hidden="true">
<?php echo esc_html( Projects::get_provider_label( $post_id ) ); ?>
<?php echo esc_html( Projects::get_provider_label( $project_id ) ); ?>
</span>
</header>
<h3 id="project-<?php echo esc_attr( (string) $post_id ); ?>-title" class="project-card__title">
<a class="project-card__title-link" href="<?php echo esc_url( get_permalink( $post_id ) ); ?>">
<?php echo esc_html( get_the_title( $post_id ) ); ?>
<h3 id="project-<?php echo esc_attr( (string) $project_id ); ?>-title" class="project-card__title">
<a class="project-card__title-link" href="<?php echo esc_url( get_permalink( $project_id ) ); ?>">
<?php echo esc_html( get_the_title( $project_id ) ); ?>
</a>
</h3>
@@ -63,7 +63,7 @@ $card_classes = 'project-card group';
<div class="project-card__actions">
<?php if ( $release_url ) : ?>
<a class="project-card__action project-card__action--primary" href="<?php echo esc_url( Projects::get_download_url( $post_id ) ); ?>" rel="nofollow">
<a class="project-card__action project-card__action--primary" href="<?php echo esc_url( Projects::get_download_url( $project_id ) ); ?>" rel="nofollow">
<?php echo esc_html__( 'Download', 'ks-portfolio' ); ?>
</a>
<?php endif; ?>
+1
View File
@@ -14,6 +14,7 @@
*/
namespace KsPortfolio;
?>
<div class="aura-bg" aria-hidden="true">
<div class="aura-layer-1"></div>