Changeset 13306
- Timestamp:
- 07/26/2022 02:59:36 PM (2 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-actions.php
r12728 r13306 120 120 add_action( 'bp_after_setup_theme', 'bp_register_theme_compat_default_features', 10 ); 121 121 122 // Adds a new hook to be sure to enqueue scripts when `is_buddypress()` is true. 123 add_action( 'bp_enqueue_scripts', 'bp_enqueue_community_scripts' ); 124 122 125 // Load the admin. 123 126 if ( is_admin() ) { -
trunk/src/bp-core/bp-core-cssjs.php
r13002 r13306 186 186 187 187 } 188 add_action( 'bp_enqueue_ scripts','bp_core_confirmation_js' );188 add_action( 'bp_enqueue_community_scripts', 'bp_core_confirmation_js' ); 189 189 add_action( 'bp_admin_enqueue_scripts', 'bp_core_confirmation_js' ); 190 190 … … 207 207 add_action( 'bp_after_group_avatar_creation_step', 'bp_avatar_template_check' ); 208 208 } 209 add_action( 'bp_enqueue_ scripts', 'bp_core_avatar_scripts' );209 add_action( 'bp_enqueue_community_scripts', 'bp_core_avatar_scripts' ); 210 210 211 211 /** … … 222 222 bp_attachments_enqueue_scripts( 'BP_Attachment_Cover_Image' ); 223 223 } 224 add_action( 'bp_enqueue_ scripts', 'bp_core_cover_image_scripts' );224 add_action( 'bp_enqueue_community_scripts', 'bp_core_cover_image_scripts' ); 225 225 226 226 /** … … 523 523 } 524 524 } 525 add_action( 'bp_enqueue_ scripts', 'bp_add_cover_image_inline_css', 11 );525 add_action( 'bp_enqueue_community_scripts', 'bp_add_cover_image_inline_css', 11 ); 526 526 527 527 /** … … 537 537 bp_core_enqueue_livestamp(); 538 538 } 539 add_action( 'bp_enqueue_ scripts', 'bp_core_add_livestamp' );539 add_action( 'bp_enqueue_community_scripts', 'bp_core_add_livestamp' ); 540 540 541 541 /** -
trunk/src/bp-core/bp-core-dependency.php
r12728 r13306 500 500 501 501 /** 502 * Fires the 'bp_enqueue_embed_scripts' action in the <head> for BP oEmbeds. 503 * 504 * @since 2.6.0 505 */ 506 function bp_enqueue_embed_scripts() { 507 if ( ! is_buddypress() ) { 502 * Fires an action hook to enqueue scripts and styles for specific BuddyPress contexts. 503 * 504 * @since 11.0.0 505 * 506 * @param string $context The specific BuddyPress context. Supported values are `embed` and `community`. 507 * Default: `embed`. 508 */ 509 function bp_enqueue_context_scripts( $context = 'embed' ) { 510 $bp_pages_only_assets = false; 511 512 /** 513 * Filter here & return `true` to restrict BP Assets loading to BP Pages. 514 * 515 * @since 11.0.0 516 * 517 * @param bool $value False to carry on loading BP Assets "everywhere". True otherwise. 518 */ 519 $bp_pages_only = apply_filters( 'bp_enqueue_assets_in_bp_pages_only', false ); 520 521 if ( 'embed' === $context || $bp_pages_only ) { 522 $bp_pages_only_assets = true; 523 } 524 525 if ( $bp_pages_only_assets && ! is_buddypress() ) { 508 526 return; 509 527 } 510 528 511 529 /** 512 * Enqueue CSS and JS files for BuddyPress embeds. 513 * 514 * @since 2.6.0 515 */ 516 do_action( 'bp_enqueue_embed_scripts' ); 530 * Enqueue CSS and JS files for a specific BuddyPress context. 531 * 532 * @since 11.0.0 533 */ 534 do_action( "bp_enqueue_{$context}_scripts" ); 535 } 536 537 /** 538 * Fires the 'bp_enqueue_embed_scripts' action in the <head> for BP oEmbeds. 539 * 540 * @since 2.6.0 541 */ 542 function bp_enqueue_embed_scripts() { 543 return bp_enqueue_context_scripts( 'embed' ); 544 } 545 546 /** 547 * Fires the `bp_enqueue_community_scripts` action for Template packs scripts and styles. 548 * 549 * @since 11.0.0 550 */ 551 function bp_enqueue_community_scripts() { 552 return bp_enqueue_context_scripts( 'community' ); 517 553 } 518 554 -
trunk/src/bp-templates/bp-legacy/buddypress-functions.php
r13294 r13306 81 81 /** Scripts ***********************************************************/ 82 82 83 add_action( 'bp_enqueue_ scripts', array( $this, 'enqueue_styles' ) ); // Enqueue theme CSS84 add_action( 'bp_enqueue_ scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue theme JS85 add_ filter( 'bp_enqueue_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization83 add_action( 'bp_enqueue_community_scripts', array( $this, 'enqueue_styles' ) ); // Enqueue theme CSS 84 add_action( 'bp_enqueue_community_scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue theme JS 85 add_action( 'bp_enqueue_community_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization 86 86 87 87 /** Body no-js Class **************************************************/ -
trunk/src/bp-templates/bp-nouveau/buddypress-functions.php
r13189 r13306 179 179 // Scripts & Styles. 180 180 $registration_params = array( 181 'hook' => 'bp_enqueue_ scripts',181 'hook' => 'bp_enqueue_community_scripts', 182 182 'priority' => 2, 183 183 ); … … 196 196 197 197 // Enqueue theme CSS. 198 add_action( 'bp_enqueue_ scripts', array( $this, 'enqueue_styles' ) );198 add_action( 'bp_enqueue_community_scripts', array( $this, 'enqueue_styles' ) ); 199 199 200 200 // Enqueue theme JS. 201 add_action( 'bp_enqueue_ scripts', array( $this, 'enqueue_scripts' ) );201 add_action( 'bp_enqueue_community_scripts', array( $this, 'enqueue_scripts' ) ); 202 202 203 203 // Enqueue theme script localization. 204 add_ filter( 'bp_enqueue_scripts', array( $this, 'localize_scripts' ) );205 remove_action( 'bp_enqueue_ scripts', 'bp_core_confirmation_js' );204 add_action( 'bp_enqueue_community_scripts', array( $this, 'localize_scripts' ) ); 205 remove_action( 'bp_enqueue_community_scripts', 'bp_core_confirmation_js' ); 206 206 207 207 // Body no-js class.
Note: See TracChangeset
for help on using the changeset viewer.