From f650e53d9bb3e4865df7ed394a889dc75018f20b Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Sat, 23 Jan 2021 13:54:14 +0000 Subject: [PATCH] Lint --- 404.php | 4 +- archive.php | 34 +++---- page-experience-timeline.php | 14 +-- taxonomy-company.php | 182 ++++++++++++++++++----------------- 4 files changed, 118 insertions(+), 116 deletions(-) diff --git a/404.php b/404.php index 6b38d02..2cad07b 100644 --- a/404.php +++ b/404.php @@ -9,8 +9,8 @@ get_header(); ?>
-

404.

-

That's computer for Oops! Something went wrong!

+

404.

+

That's computer for Oops! Something went wrong!

diff --git a/archive.php b/archive.php index 8ae7761..c9ea7d0 100644 --- a/archive.php +++ b/archive.php @@ -9,9 +9,9 @@ get_header(); ?>
-
-

.

- +

.

+ ) ); ?> -
- -
- + +
+ */ get_template_part( 'template-parts/content', get_post_format() ); // End the loop. - endwhile; + endwhile; // If no content, include the "No posts found" template. - else : - get_template_part( 'template-parts/content', 'none' ); - endif; - ?> -
- -
- +
+ +
+ ) ); ?> -
+
diff --git a/page-experience-timeline.php b/page-experience-timeline.php index 676aee1..6446a05 100644 --- a/page-experience-timeline.php +++ b/page-experience-timeline.php @@ -22,10 +22,10 @@ get_header(); ?> * @return bool */ function within_dates( $role_start_date, $role_end_date ) { - $end_year = gmdate( 'Y' ); - $end_date = $end_year . '-12-31'; - $start_date = ( $end_year - 2 ) . '-01-01'; - $role_end_date = ( ! $role_end_date ) ? gmdate( 'Y-m-d' ) : ( ( $role_end_date > $end_date ) ? $end_date : $role_end_date ); + $end_year = gmdate( 'Y' ); + $end_date = $end_year . '-12-31'; + $start_date = ( $end_year - 2 ) . '-01-01'; + $role_end_date = ( ! $role_end_date ) ? gmdate( 'Y-m-d' ) : ( ( $role_end_date > $end_date ) ? $end_date : $role_end_date ); return ( ( ( strtotime( $role_start_date ) < strtotime( $end_date ) ) && ( strtotime( $role_start_date ) > strtotime( $start_date ) ) ) && ( strtotime( $role_end_date ) > strtotime( $start_date ) ) ); } @@ -106,7 +106,7 @@ function within_dates( $role_start_date, $role_end_date ) { $end_date = get_post_meta( get_the_ID(), 'end-date', true ); $is_current = ( ! $end_date || ( $end_date && $end_date > gmdate( 'Y-m-d' ) ) ) ? true : false; - $company = wp_get_object_terms( + $company = wp_get_object_terms( get_the_ID(), 'company', array( @@ -115,8 +115,8 @@ function within_dates( $role_start_date, $role_end_date ) { ); $role_title = htmlspecialchars_decode( strip_tags( get_the_title() ) ); - $start = get_the_date(); - $end = ( ! $end_date || ( $end_date && $end_date > gmdate( 'Y-m-d' ) ) ) ? gmdate( 'Y-m-d' ) : $end_date; + $start = get_the_date(); + $end = ( ! $end_date || ( $end_date && $end_date > gmdate( 'Y-m-d' ) ) ) ? gmdate( 'Y-m-d' ) : $end_date; ?> [ '', diff --git a/taxonomy-company.php b/taxonomy-company.php index 4fc381f..a8a3f33 100644 --- a/taxonomy-company.php +++ b/taxonomy-company.php @@ -11,44 +11,46 @@ name ) . '-->'; - $args = array( - 'post_type' => array( 'job' ), - 'tax_query' => array( - array( - 'taxonomy' => 'company', - 'field' => 'slug', - 'terms' => $company->slug, - ), - ), - 'posts_per_page' => -1, - ); + // Gets all of the roles attached to the given organisation. + $company = get_queried_object(); + echo ''; + // phpcs:disable WordPress.DB.SlowDBQuery.slow_db_query_tax_query + $args = array( + 'post_type' => array( 'job' ), + 'tax_query' => array( + array( + 'taxonomy' => 'company', + 'field' => 'slug', + 'terms' => $company->slug, + ), + ), + 'posts_per_page' => -1, + ); + // phpcs:enable - $loop = new WP_Query( $args ); + $loop = new WP_Query( $args ); ?>
'full' ) ); - // phpcs:enable - $company_name = get_queried_object()->name; + $company_logo = apply_filters( 'taxonomy-images-queried-term-image-url', '', array( 'image_size' => 'full' ) ); + // phpcs:enable + $company_name = get_queried_object()->name; ?> -
-
-
- +
+
+ 70 ) { $small = '2em'; } elseif ( strlen( $company_name ) > 35 ) { @@ -114,23 +116,23 @@ } ?>

-
-
- -
-
+
+
+ +
+
-
- have_posts() ) : ?> -
-
- -
-
- - + have_posts() ) : ?> +
+
+ +
+
+ + + have_posts() ) : echo '
'; - echo '

' . wp_kses_post( ucwords( $current_section ) ) . 's View all ' . esc_html( $loop->post_count ) . '

'; - echo '
'; + echo '

' . wp_kses_post( ucwords( $current_section ) ) . 's View all ' . esc_html( $loop->post_count ) . '

'; + echo '
'; while ( ( $loop->have_posts() ) && ( $i++ < 4 ) ) : $loop->the_post(); get_template_part( 'template-parts/content', get_post_format() ); - endwhile; - echo '
'; + endwhile; + echo '
'; echo '
'; endif; } @@ -241,8 +243,8 @@ echo ''; else : @@ -279,8 +281,8 @@ echo ''; endif; ?> -
-
+
+