Ticket #7996: 7996.01.patch
| File 7996.01.patch, 1.1 KB (added by , 7 years ago) |
|---|
-
src/bp-core/bp-core-filters.php
1035 1035 */ 1036 1036 function bp_email_set_default_tokens( $tokens, $property_name, $transform, $email ) { 1037 1037 $tokens['site.admin-email'] = bp_get_option( 'admin_email' ); 1038 $tokens['site.url'] = home_url();1038 $tokens['site.url'] = bp_get_root_domain(); 1039 1039 $tokens['email.subject'] = $email->get_subject(); 1040 1040 1041 1041 // These options are escaped with esc_html on the way into the database in sanitize_option(). … … 1082 1082 // Email preheader. 1083 1083 $post = $email->get_post_object(); 1084 1084 if ( $post ) { 1085 $switched = false; 1086 1087 // Switch to the root blog, where the email post lives. 1088 if ( ! bp_is_root_blog() ) { 1089 switch_to_blog( bp_get_root_blog_id() ); 1090 $switched = true; 1091 } 1092 1085 1093 $tokens['email.preheader'] = sanitize_text_field( get_post_meta( $post->ID, 'bp_email_preheader', true ) ); 1094 1095 if ( $switched ) { 1096 restore_current_blog(); 1097 } 1086 1098 } 1087 1099 1088 1100 return $tokens;