Changeset 6439
- Timestamp:
- 10/22/2012 07:08:52 AM (13 years ago)
- Location:
- trunk/bp-core
- Files:
-
- 2 edited
-
bp-core-filters.php (modified) (6 diffs)
-
bp-core-template-loader.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-filters.php
r6434 r6439 63 63 64 64 // Run all template parts through additional template locations 65 add_filter( 'bp_ get_template_part', 'bp_add_template_locations' );65 add_filter( 'bp_locate_template', 'bp_add_template_locations' ); 66 66 67 67 // Turn comments off for BuddyPress pages … … 239 239 return str_replace( 'PASSWORD', __( '[User Set]', 'buddypress' ), $welcome_email ); 240 240 } 241 if ( !is_admin() && empty( $_GET['e'] ) ) 242 add_filter( 'update_welcome_user_email', 'bp_core_filter_user_welcome_email' ); 241 add_filter( 'update_welcome_user_email', 'bp_core_filter_user_welcome_email' ); 243 242 244 243 /*** … … 264 263 return str_replace( $password, __( '[User Set]', 'buddypress' ), $welcome_email ); 265 264 } 266 if ( !is_admin() && empty( $_GET['e'] ) ) 267 add_filter( 'update_welcome_email', 'bp_core_filter_blog_welcome_email', 10, 4 ); 265 add_filter( 'update_welcome_email', 'bp_core_filter_blog_welcome_email', 10, 4 ); 268 266 269 267 // Notify user of signup success. … … 296 294 return false; 297 295 } 298 if ( !is_admin() ) 299 add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 ); 296 add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 ); 300 297 301 298 function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) { … … 308 305 $admin_email = 'support@' . $_SERVER['SERVER_NAME']; 309 306 310 // If this is an admin generated activation, add a param to email the311 // user login details312 $email = is_admin() ? '&e=1' : '';313 314 307 $from_name = ( '' == get_site_option( 'site_name' ) ) ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); 315 308 $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option( 'blog_charset' ) . "\"\n"; 316 $message = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%1\$s\n\n", 'buddypress' ), $activate_url . $email);309 $message = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%1\$s\n\n", 'buddypress' ), $activate_url ); 317 310 $subject = '[' . $from_name . '] ' . __( 'Activate Your Account', 'buddypress' ); 318 311 … … 329 322 return false; 330 323 } 331 if ( !is_admin() || ( is_admin() && empty( $_POST['noconfirmation'] ) ) ) 332 add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 ); 324 add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 ); 333 325 334 326 /** -
trunk/bp-core/bp-core-template-loader.php
r6394 r6439 67 67 $fallback_theme = bp_get_theme_compat_dir(); 68 68 69 // Allow templates to be filtered 70 // BuddyPress core automatically adds bp_add_template_locations() 71 $template_names = apply_filters( 'bp_locate_template', $template_names ); 72 69 73 // Try to find a template file 70 74 foreach ( (array) $template_names as $template_name ) { … … 88 92 89 93 // Check theme compatibility last 90 } else { 91 // 3rd-party plugin devs can hook into the 'bp_locate_fallback_template' 92 // filter to load custom templates for their component if desired 93 $fallback_template = apply_filters( 'bp_locate_fallback_template', trailingslashit( $fallback_theme ) . $template_name, $template_name ); 94 95 if ( file_exists( $fallback_template ) ) { 96 $located = $fallback_template; 97 break; 98 } 94 } elseif ( file_exists( trailingslashit( $fallback_theme ) . $template_name ) ) { 95 $located = trailingslashit( $fallback_theme ) . $template_name; 96 break; 99 97 } 100 98 } … … 204 202 205 203 // Loop through locations and templates and combine 206 foreach ( $locations as $location )207 foreach ( $templates as $template )208 $retval[] = trailingslashit( $location ) . $template;204 foreach ( (array) $locations as $location ) 205 foreach ( (array) $templates as $template ) 206 $retval[] = ltrim( trailingslashit( $location ) . $template, '/' ); 209 207 210 208 return apply_filters( 'bp_add_template_locations', $retval, $templates );
Note: See TracChangeset
for help on using the changeset viewer.