Changeset 14174
- Timestamp:
- 12/26/2025 07:51:49 PM (8 weeks ago)
- Location:
- branches/14.0/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
-
branches/14.0/src/bp-templates/bp-legacy/buddypress-functions.php
r14083 r14174 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 ***********************************************************/ … … 476 473 * @since 1.7.0 477 474 * 478 * @param array$classes Array of classes to append to body tag.479 * @return array $classes475 * @param string[] $classes Array of classes to append to body tag. 476 * @return string[] 480 477 */ 481 478 public function add_nojs_body_class( $classes ) { 482 if ( ! in_array( 'no-js', $classes ) ) 483 $classes[] = 'no-js'; 479 /** This filter is documented in bp-core/bp-core-dependency.php */ 480 if ( ! is_buddypress() || apply_filters( 'bp_enqueue_assets_in_bp_pages_only', true ) ) { 481 return $classes; 482 } 483 484 $classes[] = 'no-js'; 484 485 485 486 return array_unique( $classes ); … … 493 494 * @since 1.7.0 494 495 */ 495 public function localize_scripts() { 496 } 496 public function localize_scripts() {} 497 497 498 498 /** -
branches/14.0/src/bp-templates/bp-nouveau/buddypress-functions.php
r14004 r14174 224 224 remove_action( 'bp_enqueue_community_scripts', 'bp_core_confirmation_js' ); 225 225 226 /** This filter is documented in bp-core/bp-core-dependency.php */ 227 if ( is_buddypress() || ! apply_filters( 'bp_enqueue_assets_in_bp_pages_only', true ) ) { 228 // Body no-js class. 229 add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 ); 230 } 226 // Body no-js class. 227 add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 ); 231 228 232 229 // Ajax querystring. … … 475 472 * @since 3.0.0 476 473 * 477 * @param array $classes Array of classes to append to body tag. 478 * 479 * @return array $classes 474 * @param string[] $classes Array of classes to append to body tag. 475 * @return string[] 480 476 */ 481 477 public function add_nojs_body_class( $classes ) { 478 /** This filter is documented in bp-core/bp-core-dependency.php */ 479 if ( ! is_buddypress() || apply_filters( 'bp_enqueue_assets_in_bp_pages_only', true ) ) { 480 return $classes; 481 } 482 482 483 $classes[] = 'no-js'; 484 483 485 return array_unique( $classes ); 484 486 }
Note: See TracChangeset
for help on using the changeset viewer.