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
+16 -16
View File
@@ -14,34 +14,34 @@ if ( ! isset( $post ) || ! ( $post instanceof \WP_Post ) ) {
return;
}
$post_id = (int) $post->ID;
$type_label = '';
$type_terms = get_the_terms( $post_id, 'project-type' );
$project_id = (int) $post->ID;
$type_label = '';
$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 );
$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, '…' );
$card_classes = 'project-card group';
$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( $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; ?>