bp_core_deprecated_email_filters

Add support for pre-2.5 email filters.

Description

bp_core_deprecated_email_filters( (mixed) $value, (string) $property, (string) $transform, (BP_Email) $email ); 

Parameters (4)

0. $value (mixed)
The value.
1. $property (string)
Name of property.
2. $transform (string)
Return value transformation. Unused.
3. $email (BP_Email)
Email object reference.

Usage

  1. if ( !function_exists( 'bp_core_deprecated_email_filters' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/deprecated/2.5.php'; 
  3.  
  4. // The value. 
  5. $value = null; 
  6.  
  7. // Name of property. 
  8. $property = ''; 
  9.  
  10. // Return value transformation. Unused. 
  11. $transform = ''; 
  12.  
  13. // Email object reference. 
  14. $email = null; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = bp_core_deprecated_email_filters($value, $property, $transform, $email); 
  18.  

Defined (1)

The function is defined in the following location(s).

/bp-core/deprecated/2.5.php  
  1. function bp_core_deprecated_email_filters( $value, $property, $transform, $email ) { 
  2. $pre_2_5_emails = array( 
  3. 'activity-at-message',  
  4. 'activity-comment',  
  5. 'activity-comment-author',  
  6. 'core-user-registration',  
  7. 'core-user-registration-with-blog',  
  8. 'friends-request',  
  9. 'friends-request-accepted',  
  10. 'groups-at-message',  
  11. 'groups-details-updated',  
  12. 'groups-invitation',  
  13. 'groups-member-promoted',  
  14. 'groups-membership-request',  
  15. 'groups-membership-request-accepted',  
  16. 'groups-membership-request-rejected',  
  17. 'messages-unread',  
  18. 'settings-verify-email-change',  
  19. ); 
  20.  
  21. remove_filter( 'bp_email_get_property', 'bp_core_deprecated_email_filters', 20 ); 
  22. $email_type = $email->get( 'type' ); 
  23. $tokens = $email->get( 'tokens' ); 
  24. add_filter( 'bp_email_get_property', 'bp_core_deprecated_email_filters', 20, 4 ); 
  25.  
  26. // Backpat for pre-2.5 emails only. 
  27. if ( ! in_array( $email_type, $pre_2_5_emails, true ) ) { 
  28. return $value; 
  29.  
  30. $original_value = $value; 
  31. $to_changed = false; 
  32.  
  33. if ( $property === 'to' && $original_value ) { 
  34. $to_changed = true; 
  35.  
  36. $value = array_shift( $original_value ); 
  37. $recipient_name = $value->get_name(); // Value - name 
  38. $value = $value->get_address(); // Key - email 
  39.  
  40. if ( $email_type === 'activity-comment' ) { 
  41. if ( $property === 'to' ) { 
  42. /** 
  43. * Filters the user email that the new comment notification will be sent to. 
  44. * @since 1.2.0 
  45. * @deprecated 2.5.0 Use the filters in BP_Email. 
  46. * @param string $value 
  47. */ 
  48.  
  49. } elseif ( $property === 'subject' ) { 
  50. /** 
  51. * Filters the new comment notification subject that will be sent to user. 
  52. * @since 1.2.0 
  53. * @deprecated 2.5.0 Use the filters in BP_Email. 
  54. * @param string $value Email notification subject text. 
  55. * @param string $poster_name Name of the person who made the comment. 
  56. */ 
  57. $value = apply_filters( 'bp_activity_new_comment_notification_subject', $value, $tokens['poster.name'] ); 
  58.  
  59. } elseif ( $property === 'content' ) { 
  60. /** 
  61. * Filters the new comment notification message that will be sent to user. 
  62. * @since 1.2.0 
  63. * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. 
  64. * @param string $value Email notification message text. 
  65. * @param string $poster_name Name of the person who made the comment. 
  66. * @param string $content Content of the comment. 
  67. * @param string $thread_link URL permalink for the activity thread. 
  68. * @param string $deprecated Removed in 2.5; now an empty string. 
  69. */ 
  70. $value = apply_filters( 'bp_activity_new_comment_notification_message', $value, $tokens['poster.name'], $tokens['content'], $tokens['thread.url'], '' ); 
  71.  
  72. } elseif ( $email_type === 'activity-comment-author' ) { 
  73. if ( $property === 'to' ) { 
  74. /** 
  75. * Filters the user email that the new comment reply notification will be sent to. 
  76. * @since 1.2.0 
  77. * @deprecated 2.5.0 Use the filters in BP_Email. 
  78. * @param string $value 
  79. */ 
  80.  
  81. } elseif ( $property === 'subject' ) { 
  82. /** 
  83. * Filters the new comment reply notification subject that will be sent to user. 
  84. * @since 1.2.0 
  85. * @deprecated 2.5.0 Use the filters in BP_Email. 
  86. * @param string $value Email notification subject text. 
  87. * @param string $poster_name Name of the person who made the comment. 
  88. */ 
  89.  
  90. } elseif ( $property === 'content' ) { 
  91. /** 
  92. * Filters the new comment reply notification message that will be sent to user. 
  93. * @since 1.2.0 
  94. * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. 
  95. * @param string $value Email notification message text. 
  96. * @param string $poster_name Name of the person who made the comment. 
  97. * @param string $content Content of the comment. 
  98. * @param string $deprecated Removed in 2.5; now an empty string. 
  99. * @param string $thread_link URL permalink for the activity thread. 
  100. */ 
  101. $value = apply_filters( 'bp_activity_new_comment_notification_comment_author_message', $value, $tokens['poster.name'], $tokens['content'], '', $tokens['thread.url'] ); 
  102.  
  103. } elseif ( $email_type === 'activity-at-message' || $email_type === 'groups-at-message' ) { 
  104. if ( $property === 'to' ) { 
  105. /** 
  106. * Filters the user email that the @mention notification will be sent to. 
  107. * @since 1.2.0 
  108. * @deprecated 2.5.0 Use the filters in BP_Email. 
  109. * @param string $value 
  110. */ 
  111.  
  112. } elseif ( $property === 'subject' ) { 
  113. /** 
  114. * Filters the @mention notification subject that will be sent to user. 
  115. * @since 1.2.0 
  116. * @deprecated 2.5.0 Use the filters in BP_Email. 
  117. * @param string $value Email notification subject text. 
  118. * @param string $poster_name Name of the person who made the @mention. 
  119. */ 
  120. $value = apply_filters( 'bp_activity_at_message_notification_subject', $value, $tokens['poster.name'] ); 
  121.  
  122. } elseif ( $property === 'content' ) { 
  123. /** 
  124. * Filters the @mention notification message that will be sent to user. 
  125. * @since 1.2.0 
  126. * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. 
  127. * @param string $message Email notification message text. 
  128. * @param string $poster_name Name of the person who made the @mention. 
  129. * @param string $content Content of the @mention. 
  130. * @param string $message_link URL permalink for the activity message. 
  131. * @param string $deprecated Removed in 2.5; now an empty string. 
  132. */ 
  133. $value = apply_filters( 'bp_activity_at_message_notification_message', $value, $tokens['poster.name'], $tokens['content'], $tokens['mentioned.url'], '' ); 
  134.  
  135. } elseif ( $email_type === 'core-user-registration' ) { 
  136. // Filters are different according to the WordPress config. 
  137. if ( is_multisite() ) { 
  138. $registration_filters = array( 
  139. 'to' => 'bp_core_activation_signup_user_notification_to',  
  140. 'subject' => 'bp_core_activation_signup_user_notification_subject',  
  141. 'content' => 'bp_core_activation_signup_user_notification_message',  
  142. ); 
  143. } else { 
  144. $registration_filters = array( 
  145. 'to' => 'bp_core_signup_send_validation_email_to',  
  146. 'subject' => 'bp_core_signup_send_validation_email_subject',  
  147. 'content' => 'bp_core_signup_send_validation_email_message',  
  148. ); 
  149.  
  150. if ( $property === 'to' ) { 
  151. /** 
  152. * Filters the email that the notification is going to upon successful registration without blog. 
  153. * @since 1.2.0 
  154. * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. 
  155. * @param string $value User email the notification is being sent to. 
  156. * @param string $recipient_username The user's login name. 
  157. * @param array $value User email the notification is being sent to (again). 
  158. * Array key is email address, value is the name. 
  159. * @param string $key The activation key created in wpmu_signup_blog(). 
  160. * @param array $meta Removed in 2.5; now an empty array. 
  161. */ 
  162. $value = apply_filters( $registration_filters['to'], $value, $tokens['recipient.username'], $value, $tokens['key'], array() ); 
  163.  
  164. } elseif ( $property === 'subject' ) { 
  165. /** 
  166. * Filters the subject that the notification uses upon successful registration without blog. 
  167. * @since 1.2.0 
  168. * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. 
  169. * @param string $value Email notification subject text. 
  170. * @param string $recipient_username The user's login name. 
  171. * @param string $recipient_email The user's email address. 
  172. * @param string $key The activation key created in wpmu_signup_blog(). 
  173. * @param array $meta Removed in 2.5; now an empty array. 
  174. */ 
  175. $value = apply_filters( $registration_filters['subject'], $value, $tokens['recipient.username'], $tokens['recipient.email'], $tokens['key'], array() ); 
  176.  
  177. } elseif ( $property === 'content' ) { 
  178. /** 
  179. * Filters the message that the notification uses upon successful registration without blog. 
  180. * @since 1.2.0 
  181. * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. 
  182. * @param string $value The message to use. 
  183. * @param string $recipient_username The user's login name. 
  184. * @param string $recipient_email The user's email address. 
  185. * @param string $key The activation key created in wpmu_signup_blog(). 
  186. * @param array $meta Removed in 2.5; now an empty array. 
  187. */ 
  188. $value = apply_filters( $registration_filters['content'], $value, $tokens['recipient.username'], $tokens['recipient.email'], $tokens['key'], array() ); 
  189.  
  190. } elseif ( $email_type === 'core-user-registration-with-blog' ) { 
  191. if ( $property === 'to' ) { 
  192. /** 
  193. * Filters the email that the notification is going to upon successful registration with blog. 
  194. * @since 1.2.0 
  195. * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. 
  196. * @param string $value User email the notification is being sent to. 
  197. * @param string $domain The new blog domain. 
  198. * @param string $path The new blog path. 
  199. * @param string $title The site title. 
  200. * @param string $recipient_username The user's login name. 
  201. * @param string $recipient_email The user's email address. 
  202. * @param string $key The activation key created in wpmu_signup_blog(). 
  203. * @param array $meta Removed in 2.5; now an empty array. 
  204. */ 
  205. $value = apply_filters( 'bp_core_activation_signup_blog_notification_to', $value, $tokens['domain'], $tokens['path'], $tokens['title'], $tokens['recipient.username'], $tokens['recipient.email'], $tokens['key_blog'], array() ); 
  206.  
  207. } elseif ( $property === 'subject' ) { 
  208. /** 
  209. * Filters the subject that the notification uses upon successful registration with blog. 
  210. * @since 1.2.0 
  211. * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. 
  212. * @param string $value The subject to use. 
  213. * @param string $domain The new blog domain. 
  214. * @param string $path The new blog path. 
  215. * @param string $title The site title. 
  216. * @param string $recipient_username The user's login name. 
  217. * @param string $recipient_email The user's email address. 
  218. * @param string $key The activation key created in wpmu_signup_blog(). 
  219. * @param array $meta Removed in 2.5; now an empty array. 
  220. */ 
  221. $value = apply_filters( 'bp_core_activation_signup_blog_notification_subject', $value, $tokens['domain'], $tokens['path'], $tokens['title'], $tokens['recipient.username'], $tokens['recipient.email'], $tokens['key_blog'], array() ); 
  222.  
  223. } elseif ( $property === 'content' ) { 
  224. /** 
  225. * Filters the message that the notification uses upon successful registration with blog. 
  226. * @since 1.2.0 
  227. * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. 
  228. * @param string $value The message to use. 
  229. * @param string $domain The new blog domain. 
  230. * @param string $path The new blog path. 
  231. * @param string $title The site title. 
  232. * @param string $recipient_username The user's login name. 
  233. * @param string $recipient_email The user's email address. 
  234. * @param string $key The activation key created in wpmu_signup_blog(). 
  235. * @param array $meta Removed in 2.5; now an empty array. 
  236. */ 
  237. $value = apply_filters( 'bp_core_activation_signup_blog_notification_message', $value, $tokens['domain'], $tokens['path'], $tokens['title'], $tokens['recipient.username'], $tokens['recipient.email'], $tokens['key_blog'], array() ); 
  238.  
  239. } elseif ( $email_type === 'friends-request' ) { 
  240. if ( $property === 'to' ) { 
  241. /** 
  242. * Filters the email address for who is getting the friend request. 
  243. * @since 1.2.0 
  244. * @deprecated 2.5.0 Use the filters in BP_Email. 
  245. * @param string $value 
  246. */ 
  247.  
  248. } elseif ( $property === 'subject' ) { 
  249. /** 
  250. * Filters the subject for the friend request email. 
  251. * @since 1.2.0 
  252. * @deprecated 2.5.0 Use the filters in BP_Email. 
  253. * @param string $value Subject line to be used in friend request email. 
  254. * @param string $initiator_name Name of the person requesting friendship. 
  255. */ 
  256. $value = apply_filters( 'friends_notification_new_request_subject', $value, $tokens['initiator.name'] ); 
  257.  
  258. } elseif ( $property === 'content' ) { 
  259. /** 
  260. * Filters the message for the friend request email. 
  261. * @since 1.2.0 
  262. * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. 
  263. * @param string $value Message to be used in friend request email. 
  264. * @param string $initiator_name Name of the person requesting friendship. 
  265. * @param string $initiator_link Profile link of person requesting friendship. 
  266. * @param string $all_requests_link User's friends request management link. 
  267. * @param string $settings_link Removed in 2.5; now an empty string. 
  268. */ 
  269. $value = apply_filters( 'friends_notification_new_request_message', $value, $tokens['initiator.name'], $tokens['initiator.url'], $tokens['friend-requests.url'], '' ); 
  270.  
  271. } elseif ( $email_type === 'friends-request-accepted' ) { 
  272. if ( $property === 'to' ) { 
  273. /** 
  274. * Filters the email address for whose friend request got accepted. 
  275. * @since 1.2.0 
  276. * @deprecated 2.5.0 Use the filters in BP_Email. 
  277. * @param string $value Email address for whose friend request got accepted. 
  278. */ 
  279.  
  280. } elseif ( $property === 'subject' ) { 
  281. /** 
  282. * Filters the subject for the friend request accepted email. 
  283. * @since 1.2.0 
  284. * @deprecated 2.5.0 Use the filters in BP_Email. 
  285. * @param string $value Subject line to be used in friend request accepted email. 
  286. * @param string $friend_name Name of the person who accepted the friendship request. 
  287. */ 
  288. $value = apply_filters( 'friends_notification_accepted_request_subject', $value, $tokens['friend.name'] ); 
  289.  
  290. } elseif ( $property === 'content' ) { 
  291. /** 
  292. * Filters the message for the friend request accepted email. 
  293. * @since 1.2.0 
  294. * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. 
  295. * @param string $value Message to be used in friend request email. 
  296. * @param string $friend_name Name of the person who accepted the friendship request. 
  297. * @param string $friend_link Profile link of person who accepted the friendship request. 
  298. * @param string $settings_link Removed in 2.5; now an empty string. 
  299. */ 
  300. $value = apply_filters( 'friends_notification_accepted_request_message', $value, $tokens['friend.name'], $tokens['friendship.url'], '' ); 
  301.  
  302. } elseif ( $email_type === 'groups-details-updated' ) { 
  303. if ( $property === 'to' ) { 
  304. /** 
  305. * Filters the user email that the group update notification will be sent to. 
  306. * @since 1.2.0 
  307. * @deprecated 2.5.0 Use the filters in BP_Email. 
  308. * @param string $value User email the notification is being sent to. 
  309. */ 
  310.  
  311. } elseif ( $property === 'subject' ) { 
  312. /** 
  313. * Filters the group update notification subject that will be sent to user. 
  314. * @since 1.2.0 
  315. * @deprecated 2.5.0 Use the filters in BP_Email. 
  316. * @param string $value Email notification subject text. 
  317. * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 
  318. */ 
  319. $value = apply_filters_ref_array( 'groups_notification_group_updated_subject', array( $value, &$tokens['group'] ) ); 
  320.  
  321. } elseif ( $property === 'content' ) { 
  322. /** 
  323. * Filters the group update notification message that will be sent to user. 
  324. * @since 1.2.0 
  325. * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. 
  326. * @param string $value Email notification message text. 
  327. * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 
  328. * @param string $group_link URL permalink to the group that was updated. 
  329. * @param string $settings_link Removed in 2.5; now an empty string. 
  330. */ 
  331. $value = apply_filters_ref_array( 'groups_notification_group_updated_message', array( $value, &$tokens['group'], $tokens['group.url'], '' ) ); 
  332.  
  333. } elseif ( $email_type === 'groups-invitation' ) { 
  334. if ( $property === 'to' ) { 
  335. /** 
  336. * Filters the user email that the group invite notification will be sent to. 
  337. * @since 1.2.0 
  338. * @deprecated 2.5.0 Use the filters in BP_Email. 
  339. * @param string $value User email the invite notification is being sent to. 
  340. */ 
  341.  
  342. } elseif ( $property === 'subject' ) { 
  343. /** 
  344. * Filters the group invite notification subject that will be sent to user. 
  345. * @since 1.2.0 
  346. * @deprecated 2.5.0 Use the filters in BP_Email. 
  347. * @param string $value Invite notification email subject text. 
  348. * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 
  349. */ 
  350. $value = apply_filters_ref_array( 'groups_notification_group_invites_subject', array( $value, &$tokens['group'] ) ); 
  351.  
  352. } elseif ( $property === 'content' ) { 
  353. /** 
  354. * Filters the group invite notification message that will be sent to user. 
  355. * @since 1.2.0 
  356. * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. 
  357. * @param string $value Invite notification email message text. 
  358. * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 
  359. * @param string $inviter_name Username for the person doing the inviting. 
  360. * @param string $inviter_link Profile link for the person doing the inviting. 
  361. * @param string $invites_link URL permalink for the invited user's invite management screen. 
  362. * @param string $group_link URL permalink for the group that the invite was related to. 
  363. * @param string $settings_link Removed in 2.5; now an empty string. 
  364. */ 
  365. $value = apply_filters_ref_array( 'groups_notification_group_invites_message', array( $value, &$tokens['group'], $tokens['inviter.name'], $tokens['inviter.url'], $tokens['invites.url'], $tokens['group.url'], '' ) ); 
  366.  
  367. } elseif ( $email_type === 'groups-member-promoted' ) { 
  368. if ( $property === 'to' ) { 
  369. /** 
  370. * Filters the user email that the group promotion notification will be sent to. 
  371. * @since 1.2.0 
  372. * @deprecated 2.5.0 Use the filters in BP_Email. 
  373. * @param string $value User email the promotion notification is being sent to. 
  374. */ 
  375.  
  376. } elseif ( $property === 'subject' ) { 
  377. /** 
  378. * Filters the group promotion notification subject that will be sent to user. 
  379. * @since 1.2.0 
  380. * @deprecated 2.5.0 Use the filters in BP_Email. 
  381. * @param string $value Promotion notification email subject text. 
  382. * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 
  383. */ 
  384. $value = apply_filters_ref_array( 'groups_notification_promoted_member_subject', array( $value, &$tokens['group'] ) ); 
  385.  
  386. } elseif ( $property === 'content' ) { 
  387. /** 
  388. * Filters the group promotion notification message that will be sent to user. 
  389. * @since 1.2.0 
  390. * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. 
  391. * @param string $value Promotion notification email message text. 
  392. * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 
  393. * @param string $promoted_to Role that the user was promoted to within the group. 
  394. * @param string $group_link URL permalink for the group that the promotion was related to. 
  395. * @param string $settings_link Removed in 2.5; now an empty string. 
  396. */ 
  397. $value = apply_filters_ref_array( 'groups_notification_promoted_member_message', array( $value, &$tokens['group'], $tokens['promoted_to'], $tokens['group.url'], '' ) ); 
  398.  
  399. } elseif ( $email_type === 'groups-membership-request' ) { 
  400. if ( $property === 'to' ) { 
  401. /** 
  402. * Filters the user email that the group membership request will be sent to. 
  403. * @since 1.2.0 
  404. * @deprecated 2.5.0 Use the filters in BP_Email. 
  405. * @param string $value User email the request is being sent to. 
  406. */ 
  407.  
  408. } elseif ( $property === 'subject' ) { 
  409. /** 
  410. * Filters the group membership request subject that will be sent to user. 
  411. * @since 1.2.0 
  412. * @deprecated 2.5.0 Use the filters in BP_Email. 
  413. * @param string $value Membership request email subject text. 
  414. * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 
  415. */ 
  416. $value = apply_filters_ref_array( 'groups_notification_new_membership_request_subject', array( $value, &$tokens['group'] ) ); 
  417.  
  418. } elseif ( $property === 'content' ) { 
  419. /** 
  420. * Filters the group membership request message that will be sent to user. 
  421. * @since 1.2.0 
  422. * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. 
  423. * @param string $value Membership request email message text. 
  424. * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 
  425. * @param string $requesting_user_name Username of who is requesting membership. 
  426. * @param string $profile_link URL permalink for the profile for the user requesting membership. 
  427. * @param string $group_requests URL permalink for the grouprequestsscreen for group being requested membership to. 
  428. * @param string $deprecated Removed in 2.5; now an empty string. 
  429. */ 
  430. $value = apply_filters_ref_array( 'groups_notification_new_membership_request_message', array( $value, &$tokens['group'], $tokens['requesting-user.name'], $tokens['profile.url'], $tokens['group-requests.url'], '' ) ); 
  431.  
  432. } elseif ( $email_type === 'groups-membership-request-accepted' || $email_type === 'groups-membership-request-rejected' ) { 
  433. if ( $property === 'to' ) { 
  434. /** 
  435. * Filters the user email that the group membership request result will be sent to. 
  436. * @deprecated 2.5.0 Use the filters in BP_Email. 
  437. * @param string $value User email the request is being sent to. 
  438. */ 
  439.  
  440. } elseif ( $property === 'subject' ) { 
  441. /** 
  442. * Filters the group membership request result subject that will be sent to user. 
  443. * @since 1.2.0 
  444. * @deprecated 2.5.0 Use the filters in BP_Email. 
  445. * @param string $value Membership request result email subject text. 
  446. * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 
  447. */ 
  448.  
  449. } elseif ( $property === 'content' ) { 
  450. /** 
  451. * Filters the group membership request result message that will be sent to user. 
  452. * @since 1.2.0 
  453. * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. 
  454. * @param string $value Membership request result email message text. 
  455. * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 
  456. * @param string $group_link URL permalink for the group that was requested membership for. 
  457. * @param string $deprecated Removed in 2.5; now an empty string. 
  458. */ 
  459. $value = apply_filters_ref_array( 'groups_notification_membership_request_completed_message', array( $value, &$tokens['group'], $tokens['group.url'], '' ) ); 
  460.  
  461. } elseif ( $email_type === 'messages-unread' ) { 
  462. if ( $property === 'to' ) { 
  463. /** 
  464. * Filters the user email that the message notification will be sent to. 
  465. * @since 1.2.0 
  466. * @deprecated 2.5.0 Use the filters in BP_Email. $ud argument unset and deprecated. 
  467. * @param string $value User email the message notification is being sent to. 
  468. * @param bool $deprecated Removed in 2.5; now a bool (false). 
  469. */ 
  470.  
  471. } elseif ( $property === 'subject' ) { 
  472. /** 
  473. * Filters the message notification subject that will be sent to user. 
  474. * @since 1.2.0 
  475. * @deprecated 2.5.0 Use the filters in BP_Email. $ud argument unset and deprecated. 
  476. * @param string $value Email notification subject text. 
  477. * @param string $sender_name Name of the person who sent the message. 
  478. * @param bool $deprecated Removed in 2.5; now a bool (false). 
  479. */ 
  480. $value = apply_filters( 'messages_notification_new_message_subject', $value, $tokens['sender.name'], false ); 
  481.  
  482. } elseif ( $property === 'content' ) { 
  483. /** 
  484. * Filters the message notification message that will be sent to user. 
  485. * @since 1.2.0 
  486. * @deprecated 2.5.0 Use the filters in BP_Email. 
  487. * $settings_link and $ud arguments unset and deprecated. 
  488. * @param string $value Email notification message text. 
  489. * @param string $sender_name Name of the person who sent the message. 
  490. * @param string $usersubjec Email notification subject text. 
  491. * @param string $content Content of the message. 
  492. * @param string $message_link URL permalink for the message. 
  493. * @param string $deprecated Removed in 2.5; now an empty string. 
  494. * @param bool $deprecated Removed in 2.5; now a bool (false). 
  495. */ 
  496. $value = apply_filters( 'messages_notification_new_message_message', $value, $tokens['sender.name'], $tokens['usersubject'], $tokens['content'], $tokens['message.url'], '', false ); 
  497.  
  498. } elseif ( $email_type === 'settings-verify-email-change' ) { 
  499. if ( $property === 'content' ) { 
  500. /** 
  501. * Filter the email text sent when a user changes emails. 
  502. * @since 2.1.0 
  503. * @deprecated 2.5.0 Use the filters in BP_Email. $update_user argument unset and deprecated. 
  504. * @param string $value Text of the email. 
  505. * @param string $recipient_email New user email that the current user has changed to. 
  506. * @param string $old_user_email Existing email address for the current user. 
  507. * @param bool $deprecated Removed in 2.5; now a bool (false). 
  508. */ 
  509. $value = apply_filters( 'bp_new_user_email_content', $value, $tokens['recipient.email'], $tokens['old-user.email'], false ); 
  510.  
  511. if ( $property === 'to' && $to_changed ) { 
  512. // We normally apart $to, so we often need to rebuild it. 
  513. array_unshift( $original_value, new BP_Email_Recipient( $value, $recipient_name ) ); 
  514. $value = $original_value; 
  515.  
  516. return $value;