Changeset 10484
- Timestamp:
- 01/30/2016 09:41:55 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r10481 r10484 2763 2763 */ 2764 2764 function bp_get_email( $email_type ) { 2765 $switched = false; 2766 2767 // Switch to the root blog, where the email posts live. 2768 if ( ! bp_is_root_blog() ) { 2769 switch_to_blog( bp_get_root_blog_id() ); 2770 $switched = true; 2771 } 2772 2765 2773 $args = array( 2766 2774 'no_found_rows' => true, … … 2790 2798 $post = get_posts( $args ); 2791 2799 if ( ! $post ) { 2800 if ( $switched ) { 2801 restore_current_blog(); 2802 } 2803 2792 2804 return new WP_Error( 'missing_email', __FUNCTION__, array( $email_type, $args ) ); 2793 2805 } … … 2825 2837 * @param WP_Post[] All posts retrieved by get_posts( $args ). May only contain $post. 2826 2838 */ 2827 return apply_filters( 'bp_get_email', $email, $email_type, $args, $post ); 2839 $retval = apply_filters( 'bp_get_email', $email, $email_type, $args, $post ); 2840 2841 if ( $switched ) { 2842 restore_current_blog(); 2843 } 2844 2845 return $retval; 2828 2846 } 2829 2847
Note: See TracChangeset
for help on using the changeset viewer.