1616 * @return void
1717 */
1818 function osi_posted_on ( string $ format = '' ) {
19-
2019 $ time_string = '<time class="byline--date entry-date published" datetime="%1$s">%2$s</time> ' ;
2120
2221 // 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
162161 *
163162 * @param string $class_name The class name for the logo.
164163 * @param string $size The size of the logo.
164+ * @param string $path The path to link to.
165165 *
166166 * @return string The HTML string for the linked logo.
167167 */
@@ -173,9 +173,13 @@ function osi_get_linked_logo( string $class_name = 'header-logo', string $size =
173173}
174174
175175/**
176- * Check Block Registry if a block exists
177- */
178- function osi_check_block_registry ( $ name ) {
176+ * Check Block Registry if a block exists
177+ *
178+ * @param string $name The block name.
179+ *
180+ * @return boolean
181+ */
182+ function osi_check_block_registry ( $ name ) { // phpcs:ignore
179183 // return 1 or nothing
180184 return WP_Block_Type_Registry::get_instance ()->is_registered ( $ name );
181185}
@@ -424,7 +428,6 @@ function osi_get_single_taxonomy_terms_query( \WP_Post $post, string $taxonomy_s
424428 * @return string
425429 */
426430 function osi_get_terms_from_taxonomy_links_all ( string $ tax = '' ) {
427-
428431 $ terms = get_terms ( $ tax );
429432
430433 if ( ! empty ( $ terms ) && ! is_wp_error ( $ terms ) ) {
@@ -459,7 +462,6 @@ function osi_get_terms_from_taxonomy_links_all( string $tax = '' ) {
459462 * @return string
460463 */
461464 function osi_get_terms_from_taxonomy_checkboxes ( string $ tax = '' ) {
462-
463465 $ terms = get_terms ( $ tax );
464466
465467 if ( ! empty ( $ terms ) && ! is_wp_error ( $ terms ) ) {
@@ -581,7 +583,7 @@ function osi_taxonomy_query( string $posttype = 'post', int $perpage = 6, string
581583}
582584
583585/**
584- * kses ruleset for SVG escaping
586+ * The kses ruleset for SVG escaping.
585587 *
586588 * @return array
587589 */
@@ -790,12 +792,17 @@ function ( $obj ) {
790792 * Default 'Hosted by Pressable.'
791793 * }
792794 *
793- * @param array $args An associative array of arguments.
795+ * @param array|string $args An associative array of arguments.
794796 *
795797 * @return void
796798 */
797- function osi_credits ( array $ args = array () ) {
798- $ args = wp_parse_args (
799+ function osi_credits ( $ args = array () ) {
800+ // If args are not an array, convert to array.
801+ if ( ! is_array ( $ args ) ) {
802+ $ args = (array ) $ args ;
803+ }
804+
805+ $ args = wp_parse_args (
799806 $ args ,
800807 array (
801808 'separator ' => ' ' ,
@@ -805,7 +812,6 @@ function osi_credits( array $args = array() ) {
805812 'pressable ' => sprintf ( __ ( 'Hosted by %s. ' , 'osi ' ), 'Pressable ' ),
806813 )
807814 );
808-
809815 $ credit_links = array ();
810816
811817 if ( $ args ['wpcom ' ] ) {
0 commit comments