Public Themes T1: PHP Rector fixes (#7396)

This commit is contained in:
Matthew Reishus 2023-09-28 12:50:23 -05:00 committed by GitHub
parent ce0c116051
commit db84854898
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 6 deletions

View file

@ -59,7 +59,8 @@ if ( empty( $featured_page_description ) && ! empty( $featured_options[ 'tag-des
if ( $i <= 3 ) {
if ( 1 !== count( $featured_content ) ) {
$f_count = is_countable( $featured_content ) ? count( $featured_content ) : 0;
if ( 1 !== $f_count ) {
// Include the standard featured content template.
get_template_part( 'components/features/featured-content/content', 'featured' );
} else {
@ -78,4 +79,4 @@ if ( empty( $featured_page_description ) && ! empty( $featured_options[ 'tag-des
</div>
<?php } ?>
</div>
<?php } ?>
<?php } ?>

View file

@ -15,7 +15,7 @@
if ( 'post' === get_post_type() ) { ?>
<div class="entry-meta">
<?php $category = get_the_category();
$category_count = ( count( $category ) );
$category_count = is_countable( $category ) ? count( $category ) : 0;
if ( $category && $category_count >= 2 ) {
$cat_links = '<a href="' . esc_url( get_permalink() ) . '">' . $category[0]->name.'&hellip;</a>';
@ -80,4 +80,4 @@
</g></g>
</svg>
<?php } ?>
</article><!-- #post-## -->
</article><!-- #post-## -->

View file

@ -117,7 +117,7 @@ function textbook_categorized_blog() {
) );
// Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats );
$all_the_cool_cats = is_countable( $all_the_cool_cats ) ? count( $all_the_cool_cats ) : 0;
set_transient( 'textbook_categories', $all_the_cool_cats );
}

View file

@ -126,7 +126,7 @@ function toujours_categorized_blog() {
) );
// Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats );
$all_the_cool_cats = is_countable( $all_the_cool_cats ) ? count( $all_the_cool_cats ) : 0;
set_transient( 'toujours_categories', $all_the_cool_cats );
}