Skip to content

Commit

Permalink
PHP 8.2: Default $example empty string rather than null #220
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Sep 15, 2023
1 parent 8b6ca87 commit 06ae142
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libs/oik-sc-help.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,10 +618,10 @@ function playlist__syntax( $shortcode="playlist" ) {
* Note: The cached version may have been created for a different locale
* In tests we might need to reset it by calling bw_expand_shortcode with null
*
* @param string|null $example shortcode to be expanded
* @param string $example shortcode to be expanded. Cannot be null in PHP 8.2
* @return string the generated HTML
*/
function bw_expand_shortcode( $example=null ) {
function bw_expand_shortcode( $example='' ) {
static $previous_example = null;
static $previous_expanded = null;
static $previous_locale = null;
Expand All @@ -631,6 +631,7 @@ function bw_expand_shortcode( $example=null ) {
} else {
bw_save_scripts();
bw_push();

$expanded = apply_filters( 'the_content', $example );
bw_pop();
bw_save_scripts();
Expand Down

0 comments on commit 06ae142

Please sign in to comment.