Changeset 14022
- Timestamp:
- 09/10/2024 05:10:17 PM (5 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/buddypress-functions.php
r14003 r14022 5 5 * @since 3.0.0 6 6 * @package BuddyPress 7 * @version 1 2.0.07 * @version 15.0.0 8 8 * 9 9 * @buddypress-template-pack { … … 51 51 public static function get_instance() { 52 52 if ( null === self::$instance ) { 53 self::$instance = new self ;53 self::$instance = new self(); 54 54 } 55 55 … … 101 101 require $this->includes_dir . 'ajax.php'; 102 102 103 // Load AJAX code only on AJAX requests.103 // Load AJAX code only on AJAX requests. 104 104 } else { 105 add_action( 'admin_init', function () { 106 if ( defined( 'DOING_AJAX' ) && true === DOING_AJAX ) { 107 require bp_nouveau()->includes_dir . 'ajax.php'; 108 } 109 }, 0 ); 105 add_action( 106 'admin_init', 107 function () { 108 if ( wp_doing_ajax() ) { 109 require bp_nouveau()->includes_dir . 'ajax.php'; 110 } 111 }, 112 0 113 ); 110 114 } 111 115 … … 122 126 ); 123 127 124 // When BP Classic is activated, regular themes need this filter. 128 // When BP Classic is activated, regular themes need this filter. 125 129 if ( function_exists( 'bp_classic' ) ) { 126 130 // Set the BP Uri for the Ajax customizer preview. … … 138 142 } 139 143 140 require ( $component_loader );144 require $component_loader; 141 145 } 142 146 … … 242 246 add_action( 'bp_nouveau_feedback_messages', array( $this, 'filter_registration_messages' ), 99 ); 243 247 244 /** Override **********************************************************/245 246 248 /** 247 249 * Fires after all of the BuddyPress theme compat actions have been added. … … 287 289 * @param array $value Array of styles to enqueue. 288 290 */ 289 $styles = apply_filters( 'bp_nouveau_enqueue_styles', array( 290 'bp-nouveau' => array( 291 'file' => 'css/buddypress%1$s%2$s.css', 'dependencies' => $css_dependencies, 'version' => $this->version, 292 ), 293 'bp-nouveau-priority-nav' => array( 294 'file' => 'css/priority-nav%1$s%2$s.css', 'dependencies' => array( 'dashicons' ), 'version' => $this->version, 295 ), 296 ) ); 291 $styles = apply_filters( 292 'bp_nouveau_enqueue_styles', 293 array( 294 'bp-nouveau' => array( 295 'file' => 'css/buddypress%1$s%2$s.css', 296 'dependencies' => $css_dependencies, 297 'version' => $this->version, 298 ), 299 'bp-nouveau-priority-nav' => array( 300 'file' => 'css/priority-nav%1$s%2$s.css', 301 'dependencies' => array( 'dashicons' ), 302 'version' => $this->version, 303 ), 304 ) 305 ); 297 306 298 307 if ( $styles ) { … … 388 397 'bp_nouveau_register_scripts', 389 398 array( 390 'bp-nouveau' => array(399 'bp-nouveau' => array( 391 400 'file' => 'js/buddypress-nouveau%s.js', 392 401 'dependencies' => $dependencies, … … 399 408 'version' => $this->version, 400 409 'footer' => true, 401 ) 410 ), 402 411 ) 403 412 ); … … 493 502 public function localize_scripts() { 494 503 $params = array( 495 'ajaxurl' 496 'confirm' 504 'ajaxurl' => bp_core_ajax_url(), 505 'confirm' => __( 'Are you sure?', 'buddypress' ), 497 506 498 507 /* translators: %s: number of activity comments */ 499 'show_x_comments' 500 'unsaved_changes' 501 'object_nav_parent' 508 'show_x_comments' => __( 'Show all %d comments', 'buddypress' ), 509 'unsaved_changes' => __( 'Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress' ), 510 'object_nav_parent' => '#buddypress', 502 511 ); 503 512 … … 678 687 679 688 foreach ( $nav_items as $nav_item ) { 680 if ( empty( $nav_item['component'] ) || $nav_item['component'] !== bp_current_component()) {689 if ( empty( $nav_item['component'] ) || bp_current_component() !== $nav_item['component'] ) { 681 690 continue; 682 691 }
Note: See TracChangeset
for help on using the changeset viewer.