Skip to content

Commit d45046d

Browse files
committed
Fix issues with incorrect type
1 parent ba63ca3 commit d45046d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

themes/osi/inc/template-tags.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -790,11 +790,16 @@ function ( $obj ) {
790790
* Default 'Hosted by Pressable.'
791791
* }
792792
*
793-
* @param array $args An associative array of arguments.
793+
* @param array|string $args An associative array of arguments.
794794
*
795795
* @return void
796796
*/
797-
function osi_credits( array $args = array() ) {
797+
function osi_credits( $args = array() ) {
798+
// If args are not an array, convert to array.
799+
if ( ! is_array( $args ) ) {
800+
$args = (array) $args;
801+
}
802+
798803
$args = wp_parse_args(
799804
$args,
800805
array(
@@ -805,7 +810,6 @@ function osi_credits( array $args = array() ) {
805810
'pressable' => sprintf( __( 'Hosted by %s.', 'osi' ), 'Pressable' ),
806811
)
807812
);
808-
809813
$credit_links = array();
810814

811815
if ( $args['wpcom'] ) {

0 commit comments

Comments
 (0)