Skip to content

Commit

Permalink
Update colophon.php
Browse files Browse the repository at this point in the history
Add fallback in case misconfigured and phpdoc for new param
  • Loading branch information
georgestephanis authored Feb 1, 2024
1 parent b0225a0 commit 99630d5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion colophon.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* Usage: team51_credits( 'separator= | ' );
*
* @param array{separator?: string, wpcom?: string, pressable?: string} $args The Args passed to the function.
* @param array{separator?: string, wpcom?: string, pressable?: string, return?: boolean} $args The Args passed to the function.
*
* @return void
*/
Expand All @@ -33,6 +33,11 @@ function team51_credits( $args = array() ) {
)
);

// Protect against folks mistakenly passing 'return' in which would prevent anything from echoing on the action.
if ( doing_action( 'team51_credits' ) ) {
$args['return'] = false;
}

$credit_links = array();
$parsed_url = wp_parse_url( get_site_url(), PHP_URL_HOST );
$partner_domain = $parsed_url ? $parsed_url : 'wpspecialprojects.com';
Expand Down

0 comments on commit 99630d5

Please sign in to comment.