Changeset 14175
- Timestamp:
- 12/26/2025 07:53:17 PM (3 days ago)
- Location:
- trunk/src/bp-templates
- Files:
-
- 2 edited
-
bp-legacy/buddypress-functions.php (modified) (3 diffs)
-
bp-nouveau/buddypress-functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-legacy/buddypress-functions.php
r14068 r14175 85 85 add_action( 'bp_enqueue_community_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization 86 86 87 /** This filter is documented in bp-core/bp-core-dependency.php */ 88 if ( is_buddypress() || ! apply_filters( 'bp_enqueue_assets_in_bp_pages_only', true ) ) { 89 // Body no-js class. 90 add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 ); 91 } 87 // Body no-js class. 88 add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 ); 92 89 93 90 /** Buttons ***********************************************************/ … … 477 474 * @since 1.7.0 478 475 * 479 * @param array$classes Array of classes to append to body tag.480 * @return array $classes476 * @param string[] $classes Array of classes to append to body tag. 477 * @return string[] 481 478 */ 482 479 public function add_nojs_body_class( $classes ) { 483 if ( ! in_array( 'no-js', $classes ) ) 484 $classes[] = 'no-js'; 480 /** This filter is documented in bp-core/bp-core-dependency.php */ 481 if ( ! is_buddypress() || apply_filters( 'bp_enqueue_assets_in_bp_pages_only', true ) ) { 482 return $classes; 483 } 484 485 $classes[] = 'no-js'; 485 486 486 487 return array_unique( $classes ); … … 494 495 * @since 1.7.0 495 496 */ 496 public function localize_scripts() { 497 } 497 public function localize_scripts() {} 498 498 499 499 /** -
trunk/src/bp-templates/bp-nouveau/buddypress-functions.php
r14068 r14175 228 228 remove_action( 'bp_enqueue_community_scripts', 'bp_core_confirmation_js' ); 229 229 230 /** This filter is documented in bp-core/bp-core-dependency.php */ 231 if ( is_buddypress() || ! apply_filters( 'bp_enqueue_assets_in_bp_pages_only', true ) ) { 232 // Body no-js class. 233 add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 ); 234 } 230 // Body no-js class. 231 add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 ); 235 232 236 233 // Ajax querystring. … … 484 481 * @since 3.0.0 485 482 * 486 * @param array $classes Array of classes to append to body tag. 487 * 488 * @return array $classes 483 * @param string[] $classes Array of classes to append to body tag. 484 * @return string[] 489 485 */ 490 486 public function add_nojs_body_class( $classes ) { 487 /** This filter is documented in bp-core/bp-core-dependency.php */ 488 if ( ! is_buddypress() || apply_filters( 'bp_enqueue_assets_in_bp_pages_only', true ) ) { 489 return $classes; 490 } 491 491 492 $classes[] = 'no-js'; 493 492 494 return array_unique( $classes ); 493 495 }
Note: See TracChangeset
for help on using the changeset viewer.