| @@ -342,8 +342,10 @@ | ||
| 342 | 342 | } |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | if ( $has_bbpress_shortcode ) { |
| 346 | + $GLOBALS['forumax_is_shortcode_page'] = true; | |
| 347 | + | |
| 346 | 348 | // Add body class for styling. |
| 347 | 349 | add_filter( 'body_class', function( $classes ) { |
| 348 | 350 | $classes[] = 'forumax-shortcode-page'; |
| 349 | 351 | $classes[] = 'forumax-fse'; |
| @@ -409,9 +411,9 @@ | ||
| 409 | 411 | } |
| 410 | 412 | |
| 411 | 413 | // Check for bbPress page OR shortcode page. |
| 412 | 414 | $is_bbpress_page = function_exists( 'is_bbpress' ) && is_bbpress(); |
| 413 | - $is_shortcode_page = in_array( 'forumax-shortcode-page', get_body_class(), true ); | |
| 415 | + $is_shortcode_page = ! empty( $GLOBALS['forumax_is_shortcode_page'] ); | |
| 414 | 416 | |
| 415 | 417 | if ( ! $is_bbpress_page && ! $is_shortcode_page ) { |
| 416 | 418 | return; |
| 417 | 419 | } |
| @@ -480,11 +482,12 @@ | ||
| 480 | 482 | return; |
| 481 | 483 | } |
| 482 | 484 | |
| 483 | 485 | // Check for bbPress page OR shortcode page. |
| 484 | - $is_bbpress_page = function_exists( 'is_bbpress' ) && is_bbpress(); | |
| 486 | + $is_bbpress_page = function_exists( 'is_bbpress' ) && is_bbpress(); | |
| 487 | + $is_shortcode_page = ! empty( $GLOBALS['forumax_is_shortcode_page'] ); | |
| 485 | 488 | |
| 486 | - if ( ! $is_bbpress_page ) { | |
| 489 | + if ( ! $is_bbpress_page && ! $is_shortcode_page ) { | |
| 487 | 490 | return; |
| 488 | 491 | } |
| 489 | 492 | |
| 490 | 493 | // Ensure bbPress default styles are loaded. |