diff --git a/themes/osi/inc/template-tags.php b/themes/osi/inc/template-tags.php index 1c98c8d..c1369b9 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. @@ -162,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. */ @@ -173,9 +173,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 +428,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 +462,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 +583,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 */ @@ -790,12 +792,17 @@ 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() ) { - $args = wp_parse_args( +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( 'separator' => ' ', @@ -805,7 +812,6 @@ function osi_credits( array $args = array() ) { 'pressable' => sprintf( __( 'Hosted by %s.', 'osi' ), 'Pressable' ), ) ); - $credit_links = array(); if ( $args['wpcom'] ) {