From d45046d52eb59437970d451508001409b1abd7bf Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Tue, 13 May 2025 09:22:08 +0100 Subject: [PATCH 1/3] Fix issues with incorrect type --- themes/osi/inc/template-tags.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/themes/osi/inc/template-tags.php b/themes/osi/inc/template-tags.php index 1c98c8d..8f25efd 100755 --- a/themes/osi/inc/template-tags.php +++ b/themes/osi/inc/template-tags.php @@ -790,11 +790,16 @@ function ( $obj ) { * Default 'Hosted by Pressable.' * } * - * @param array $args An associative array of arguments. + * @param array|string $args An associative array of arguments. * * @return void */ -function osi_credits( array $args = array() ) { +function osi_credits( $args = array() ) { + // If args are not an array, convert to array. + if ( ! is_array( $args ) ) { + $args = (array) $args; + } + $args = wp_parse_args( $args, array( @@ -805,7 +810,6 @@ function osi_credits( array $args = array() ) { 'pressable' => sprintf( __( 'Hosted by %s.', 'osi' ), 'Pressable' ), ) ); - $credit_links = array(); if ( $args['wpcom'] ) { From 4680d447f13d56f9ef62ebd854944191fcb4bf46 Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Tue, 13 May 2025 09:26:34 +0100 Subject: [PATCH 2/3] Fix simple liniting issues --- themes/osi/inc/template-tags.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/themes/osi/inc/template-tags.php b/themes/osi/inc/template-tags.php index 8f25efd..9a45a06 100755 --- a/themes/osi/inc/template-tags.php +++ b/themes/osi/inc/template-tags.php @@ -16,7 +16,6 @@ * @return void */ function osi_posted_on( string $format = '' ) { - $time_string = ''; // Don't display the updated date for blog posts and meeting-minutes. @@ -173,9 +172,13 @@ function osi_get_linked_logo( string $class_name = 'header-logo', string $size = } /** -* Check Block Registry if a block exists -*/ -function osi_check_block_registry( $name ) { + * Check Block Registry if a block exists + * + * @param string $name The block name. + * + * @return boolean + */ +function osi_check_block_registry( $name ) { // phpcs:ignore // return 1 or nothing return WP_Block_Type_Registry::get_instance()->is_registered( $name ); } @@ -424,7 +427,6 @@ function osi_get_single_taxonomy_terms_query( \WP_Post $post, string $taxonomy_s * @return string */ function osi_get_terms_from_taxonomy_links_all( string $tax = '' ) { - $terms = get_terms( $tax ); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) { @@ -459,7 +461,6 @@ function osi_get_terms_from_taxonomy_links_all( string $tax = '' ) { * @return string */ function osi_get_terms_from_taxonomy_checkboxes( string $tax = '' ) { - $terms = get_terms( $tax ); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) { @@ -581,7 +582,7 @@ function osi_taxonomy_query( string $posttype = 'post', int $perpage = 6, string } /** - * kses ruleset for SVG escaping + * The kses ruleset for SVG escaping. * * @return array */ @@ -800,7 +801,7 @@ function osi_credits( $args = array() ) { $args = (array) $args; } - $args = wp_parse_args( + $args = wp_parse_args( $args, array( 'separator' => ' ', From 36e5c4652d9bade7be483bacd92eef9106ce922f Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Tue, 13 May 2025 09:27:45 +0100 Subject: [PATCH 3/3] Fix simple liniting issues --- themes/osi/inc/template-tags.php | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/osi/inc/template-tags.php b/themes/osi/inc/template-tags.php index 9a45a06..c1369b9 100755 --- a/themes/osi/inc/template-tags.php +++ b/themes/osi/inc/template-tags.php @@ -161,6 +161,7 @@ function osi_linked_logo( string $class_name = 'header-logo', string $size = 'la * * @param string $class_name The class name for the logo. * @param string $size The size of the logo. + * @param string $path The path to link to. * * @return string The HTML string for the linked logo. */