Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict comparison missign with post get_post_type() check #339

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

// Groups jobs according to job category.
foreach ( $job_categories as $i => $category ) {
$job_category_jobs[ $category->slug ] = Jobs_Dot_WP::get_jobs_for_category( $category );
$latest_post = $job_category_jobs[ $category->slug ][0];
$job_category_jobs[ $category->slug ] = Jobs_Dot_WP::get_jobs_for_category( $category );
$latest_post = $job_category_jobs[ $category->slug ][0];
// Add key for sorting.
$job_categories[ $i ]->latest_post_date = $latest_post ? $latest_post->post_date : '0';
}

// Sort job categories according to recency of latest post.
$job_categories = wp_list_sort( $job_categories, [ 'latest_post_date' => 'DESC', 'name' => 'ASC' ] );
// Sort job categories according to recency of latest post.

// Display the categories and their jobs.
foreach ( $job_categories as $category ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<header class="entry-header">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>

<?php if ( 'post' == get_post_type() ) : ?>
<?php if ( 'post' === get_post_type() ) : ?>
<div class="entry-meta">
<?php jobswp_posted_on(); ?>
</div><!-- .entry-meta -->
Expand All @@ -32,7 +32,7 @@
<?php endif; ?>

<footer class="entry-meta">
<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
<?php if ( 'post' === get_post_type() ) : // Hide category and tag text for pages on Search ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'jobswp' ) );
Expand All @@ -54,7 +54,7 @@
<?php endif; // End if $tags_list ?>
<?php endif; // End if 'post' == get_post_type() ?>

<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
<?php if ( ! post_password_required() && ( comments_open() || '0' !== get_comments_number() ) ) : ?>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'jobswp' ), __( '1 Comment', 'jobswp' ), __( '% Comments', 'jobswp' ) ); ?></span>
<?php endif; ?>

Expand Down