BuddyPress - Version 2.3.1

Version Description

See: https://codex.buddypress.org/releases/version-2-3-1/

Download this release

Release Info

Developer johnjamesjacoby
Plugin Icon 128x128 BuddyPress
Version 2.3.1
Comparing to
See all releases

Code changes from version 2.4.0 to 2.3.1

Files changed (368) hide show
  1. bp-activity/admin/css/admin-rtl.css +0 -7
  2. bp-activity/admin/css/admin-rtl.min.css +1 -1
  3. bp-activity/admin/css/admin.css +0 -7
  4. bp-activity/admin/css/admin.min.css +1 -1
  5. bp-activity/admin/js/admin.js +7 -7
  6. bp-activity/admin/js/admin.min.js +1 -1
  7. bp-activity/bp-activity-actions.php +85 -82
  8. bp-activity/bp-activity-admin.php +227 -337
  9. bp-activity/bp-activity-akismet.php +79 -75
  10. bp-activity/bp-activity-cache.php +7 -8
  11. bp-activity/bp-activity-classes.php +3 -3
  12. bp-activity/bp-activity-cssjs.php +5 -25
  13. bp-activity/bp-activity-filters.php +89 -76
  14. bp-activity/bp-activity-functions.php +328 -277
  15. bp-activity/bp-activity-loader.php +62 -64
  16. bp-activity/bp-activity-notifications.php +50 -46
  17. bp-activity/bp-activity-screens.php +60 -57
  18. bp-activity/bp-activity-template.php +441 -438
  19. bp-activity/classes/class-bp-activity-activity.php +221 -214
  20. bp-activity/classes/class-bp-activity-feed.php +60 -61
  21. bp-activity/classes/class-bp-activity-query.php +30 -18
  22. bp-activity/js/mentions.js +38 -32
  23. bp-activity/js/mentions.min.js +2 -2
  24. bp-blogs/bp-blogs-actions.php +2 -1
  25. bp-blogs/bp-blogs-activity.php +85 -121
  26. bp-blogs/bp-blogs-cache.php +7 -6
  27. bp-blogs/bp-blogs-classes.php +2 -1
  28. bp-blogs/bp-blogs-filters.php +10 -12
  29. bp-blogs/bp-blogs-functions.php +102 -134
  30. bp-blogs/bp-blogs-loader.php +38 -51
  31. bp-blogs/bp-blogs-screens.php +22 -21
  32. bp-blogs/bp-blogs-template.php +162 -175
  33. bp-blogs/bp-blogs-widgets.php +8 -12
  34. bp-blogs/classes/class-bp-blogs-blog.php +58 -69
  35. bp-core/admin/bp-core-admin-actions.php +24 -23
  36. bp-core/admin/bp-core-admin-components.php +17 -17
  37. bp-core/admin/bp-core-admin-functions.php +60 -72
  38. bp-core/admin/bp-core-admin-schema.php +26 -25
  39. bp-core/admin/bp-core-admin-settings.php +57 -85
  40. bp-core/admin/bp-core-admin-slugs.php +12 -10
  41. bp-core/admin/bp-core-admin-tools.php +22 -28
  42. bp-core/admin/css/common-rtl.css +271 -77
  43. bp-core/admin/css/common-rtl.min.css +1 -1
  44. bp-core/admin/css/common.css +271 -77
  45. bp-core/admin/css/common.min.css +1 -1
  46. bp-core/admin/images/accessibility.gif +0 -0
  47. bp-core/admin/images/avatar-ui.gif +0 -0
  48. bp-core/admin/images/group-cover-image.png +0 -0
  49. bp-core/admin/images/group-home-page.png +0 -0
  50. bp-core/admin/images/icons32.png +0 -0
  51. bp-core/admin/images/icons64.png +0 -0
  52. bp-core/admin/images/member-type-field.png +0 -0
  53. bp-core/admin/images/menu-2x.png +0 -0
  54. bp-core/admin/images/menu-wp.png +0 -0
  55. bp-core/admin/images/menu.png +0 -0
  56. bp-core/admin/images/theme-stylesheets.png +0 -0
  57. bp-core/bp-core-actions.php +13 -12
  58. bp-core/bp-core-admin.php +100 -125
  59. bp-core/bp-core-adminbar.php +8 -7
  60. bp-core/bp-core-attachments.php +36 -1003
  61. bp-core/bp-core-avatars.php +290 -392
  62. bp-core/bp-core-buddybar.php +139 -369
  63. bp-core/bp-core-cache.php +22 -29
  64. bp-core/bp-core-caps.php +54 -88
  65. bp-core/bp-core-catchuri.php +47 -69
  66. bp-core/bp-core-classes.php +1 -2
  67. bp-core/bp-core-component.php +77 -93
  68. bp-core/bp-core-cssjs.php +15 -134
  69. bp-core/bp-core-dependency.php +59 -68
  70. bp-core/bp-core-filters.php +61 -201
  71. bp-core/bp-core-functions.php +167 -213
  72. bp-core/bp-core-loader.php +70 -25
  73. bp-core/bp-core-moderation.php +17 -20
  74. bp-core/bp-core-options.php +88 -164
  75. bp-core/bp-core-taxonomy.php +7 -15
  76. bp-core/bp-core-template-loader.php +58 -76
  77. bp-core/bp-core-template.php +217 -341
  78. bp-core/bp-core-theme-compatibility.php +69 -248
  79. bp-core/bp-core-update.php +385 -388
  80. bp-core/bp-core-widgets.php +26 -37
  81. bp-core/bp-core-wpabstraction.php +9 -16
  82. bp-core/classes/class-bp-attachment-avatar.php +74 -110
  83. bp-core/classes/class-bp-attachment-cover-image.php +0 -284
  84. bp-core/classes/class-bp-attachment.php +73 -229
  85. bp-core/classes/class-bp-button.php +33 -33
  86. bp-core/classes/class-bp-core-notification.php +29 -55
  87. bp-core/classes/class-bp-core-user.php +60 -68
  88. bp-core/classes/class-bp-date-query.php +4 -8
  89. bp-core/classes/class-bp-embed.php +16 -18
  90. bp-core/classes/class-bp-media-extractor.php +131 -168
  91. bp-core/classes/class-bp-members-suggestions.php +13 -15
  92. bp-core/classes/class-bp-recursive-query.php +21 -16
  93. bp-core/classes/class-bp-suggestions.php +14 -16
  94. bp-core/classes/class-bp-user-query.php +126 -171
  95. bp-core/classes/class-bp-walker-nav-menu-checklist.php +15 -15
  96. bp-core/classes/class-bp-walker-nav-menu.php +22 -23
  97. bp-core/css/avatar-rtl.css +7 -15
  98. bp-core/css/avatar-rtl.min.css +1 -1
  99. bp-core/css/avatar.css +7 -15
  100. bp-core/css/avatar.min.css +1 -1
  101. bp-core/css/buddybar-rtl.min.css +1 -1
  102. bp-core/css/buddybar.min.css +1 -1
  103. bp-core/deprecated/1.2.php +2 -2
  104. bp-core/deprecated/1.5.php +73 -84
  105. bp-core/deprecated/1.6.php +21 -20
  106. bp-core/deprecated/1.7.php +12 -12
  107. bp-core/deprecated/1.9.php +10 -9
  108. bp-core/deprecated/2.0.php +3 -3
  109. bp-core/deprecated/2.1.php +27 -27
  110. bp-core/deprecated/2.2.php +12 -12
  111. bp-core/deprecated/2.3.php +1 -1
  112. bp-core/deprecated/2.4.php +0 -25
  113. bp-core/deprecated/js/autocomplete/jquery.autocomplete.min.js +1 -1
  114. bp-core/deprecated/js/autocomplete/jquery.autocompletefb.min.js +1 -1
  115. bp-core/deprecated/js/autocomplete/jquery.bgiframe.min.js +1 -1
  116. bp-core/deprecated/js/autocomplete/jquery.dimensions.min.js +1 -1
  117. bp-core/js/avatar.js +5 -36
  118. bp-core/js/avatar.min.js +2 -2
  119. bp-core/js/bp-plupload.js +11 -37
  120. bp-core/js/bp-plupload.min.js +2 -2
  121. bp-core/js/confirm.min.js +1 -1
  122. bp-core/js/cover-image.js +0 -277
  123. bp-core/js/cover-image.min.js +0 -2
  124. bp-core/js/jquery-cookie.min.js +1 -1
  125. bp-core/js/jquery-query.min.js +1 -1
  126. bp-core/js/jquery-scroll-to.min.js +1 -1
  127. bp-core/js/jquery.atwho.min.js +2 -2
  128. bp-core/js/jquery.caret.min.js +2 -2
  129. bp-core/js/webcam.js +1 -1
  130. bp-core/js/webcam.min.js +2 -2
  131. bp-core/js/widget-members.min.js +1 -1
  132. bp-forums/bb-config.php +1 -4
  133. bp-forums/bp-forums-actions.php +2 -2
  134. bp-forums/bp-forums-bbpress-sa.php +54 -57
  135. bp-forums/bp-forums-bbpress.php +2 -5
  136. bp-forums/bp-forums-filters.php +14 -14
  137. bp-forums/bp-forums-functions.php +171 -180
  138. bp-forums/bp-forums-loader.php +54 -61
  139. bp-forums/bp-forums-screens.php +26 -26
  140. bp-forums/bp-forums-template.php +282 -256
  141. bp-forums/deprecated/1.6.php +18 -17
  142. bp-forums/deprecated/1.7.php +14 -13
  143. bp-friends/bp-friends-actions.php +3 -2
  144. bp-friends/bp-friends-activity.php +46 -47
  145. bp-friends/bp-friends-cache.php +15 -15
  146. bp-friends/bp-friends-classes.php +2 -2
  147. bp-friends/bp-friends-filters.php +9 -28
  148. bp-friends/bp-friends-functions.php +129 -123
  149. bp-friends/bp-friends-loader.php +52 -56
  150. bp-friends/bp-friends-notifications.php +71 -75
  151. bp-friends/bp-friends-screens.php +15 -14
  152. bp-friends/bp-friends-template.php +44 -44
  153. bp-friends/bp-friends-widgets.php +29 -29
  154. bp-friends/classes/class-bp-friends-friendship.php +77 -77
  155. bp-friends/js/widget-friends.min.js +1 -1
  156. bp-groups/admin/js/admin.min.js +1 -1
  157. bp-groups/bp-groups-actions.php +23 -21
  158. bp-groups/bp-groups-activity.php +16 -15
  159. bp-groups/bp-groups-admin.php +71 -114
  160. bp-groups/bp-groups-adminbar.php +4 -3
  161. bp-groups/bp-groups-cache.php +11 -10
  162. bp-groups/bp-groups-classes.php +1 -1
  163. bp-groups/bp-groups-filters.php +9 -7
  164. bp-groups/bp-groups-forums.php +36 -35
  165. bp-groups/bp-groups-functions.php +54 -46
  166. bp-groups/bp-groups-loader.php +112 -170
  167. bp-groups/bp-groups-notifications.php +60 -82
  168. bp-groups/bp-groups-screens.php +79 -141
  169. bp-groups/bp-groups-template.php +373 -658
  170. bp-groups/bp-groups-widgets.php +13 -22
  171. bp-groups/classes/class-bp-group-extension.php +129 -126
  172. bp-groups/classes/class-bp-group-member-query.php +10 -9
  173. bp-groups/classes/class-bp-groups-group.php +208 -205
  174. bp-groups/classes/class-bp-groups-member-suggestions.php +10 -9
  175. bp-groups/classes/class-bp-groups-member.php +97 -144
  176. bp-groups/js/widget-groups.min.js +1 -1
  177. bp-loader.php +42 -57
  178. bp-members/admin/bp-members-admin-classes.php +67 -86
  179. bp-members/admin/css/admin-rtl.css +2 -3
  180. bp-members/admin/css/admin-rtl.min.css +1 -1
  181. bp-members/admin/css/admin.css +2 -3
  182. bp-members/admin/css/admin.min.css +1 -1
  183. bp-members/admin/js/admin.js +1 -1
  184. bp-members/admin/js/admin.min.js +1 -1
  185. bp-members/bp-members-actions.php +16 -21
  186. bp-members/bp-members-activity.php +10 -7
  187. bp-members/bp-members-admin.php +221 -193
  188. bp-members/bp-members-adminbar.php +23 -34
  189. bp-members/bp-members-cache.php +3 -8
  190. bp-members/bp-members-classes.php +1 -1
  191. bp-members/bp-members-filters.php +16 -13
  192. bp-members/bp-members-functions.php +306 -286
  193. bp-members/bp-members-loader.php +46 -61
  194. bp-members/bp-members-screens.php +93 -96
  195. bp-members/bp-members-template.php +202 -255
  196. bp-members/bp-members-widgets.php +72 -73
  197. bp-members/classes/class-bp-signup.php +78 -72
  198. bp-messages/bp-messages-actions.php +13 -206
  199. bp-messages/bp-messages-cache.php +15 -15
  200. bp-messages/bp-messages-classes.php +3 -3
  201. bp-messages/bp-messages-cssjs.php +3 -2
  202. bp-messages/bp-messages-filters.php +10 -35
  203. bp-messages/bp-messages-functions.php +51 -65
  204. bp-messages/bp-messages-loader.php +64 -62
  205. bp-messages/bp-messages-notifications.php +29 -27
  206. bp-messages/bp-messages-screens.php +102 -39
  207. bp-messages/bp-messages-star.php +76 -105
  208. bp-messages/bp-messages-template.php +196 -195
  209. bp-messages/bp-messages-widgets.php +9 -9
  210. bp-messages/classes/class-bp-messages-message.php +16 -11
  211. bp-messages/classes/class-bp-messages-notice.php +18 -19
  212. bp-messages/classes/{class-bp-messages-thread.php → class-bp_messages-thread.php} +135 -157
  213. bp-notifications/bp-notifications-actions.php +24 -23
  214. bp-notifications/bp-notifications-adminbar.php +4 -5
  215. bp-notifications/bp-notifications-cache.php +15 -19
  216. bp-notifications/bp-notifications-classes.php +4 -3
  217. bp-notifications/bp-notifications-functions.php +132 -138
  218. bp-notifications/bp-notifications-loader.php +56 -61
  219. bp-notifications/bp-notifications-screens.php +9 -8
  220. bp-notifications/bp-notifications-template.php +176 -161
  221. bp-notifications/classes/class-bp-notifications-notification.php +216 -221
  222. bp-settings/bp-settings-actions.php +18 -13
  223. bp-settings/bp-settings-functions.php +2 -95
  224. bp-settings/bp-settings-loader.php +36 -41
  225. bp-settings/bp-settings-screens.php +15 -14
  226. bp-settings/bp-settings-template.php +15 -20
  227. bp-templates/bp-legacy/buddypress-functions.php +250 -418
  228. bp-templates/bp-legacy/buddypress/activity/activity-loop.php +2 -8
  229. bp-templates/bp-legacy/buddypress/activity/comment.php +8 -3
  230. bp-templates/bp-legacy/buddypress/activity/entry.php +13 -9
  231. bp-templates/bp-legacy/buddypress/activity/index.php +19 -27
  232. bp-templates/bp-legacy/buddypress/activity/post-form.php +5 -6
  233. bp-templates/bp-legacy/buddypress/activity/single/home.php +0 -9
  234. bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php +3 -4
  235. bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/crop.php +3 -4
  236. bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/index.php +4 -4
  237. bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php +0 -36
  238. bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php +4 -5
  239. bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php +12 -7
  240. bp-templates/bp-legacy/buddypress/blogs/create.php +4 -10
  241. bp-templates/bp-legacy/buddypress/blogs/index.php +14 -20
  242. bp-templates/bp-legacy/buddypress/forums/forums-loop.php +9 -8
  243. bp-templates/bp-legacy/buddypress/forums/index.php +19 -28
  244. bp-templates/bp-legacy/buddypress/groups/create.php +47 -76
  245. bp-templates/bp-legacy/buddypress/groups/groups-loop.php +8 -7
  246. bp-templates/bp-legacy/buddypress/groups/index.php +12 -18
  247. bp-templates/bp-legacy/buddypress/groups/single/activity.php +6 -15
  248. bp-templates/bp-legacy/buddypress/groups/single/admin.php +58 -86
  249. bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php +0 -123
  250. bp-templates/bp-legacy/buddypress/groups/single/forum.php +7 -13
  251. bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php +8 -15
  252. bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php +8 -15
  253. bp-templates/bp-legacy/buddypress/groups/single/group-header.php +8 -14
  254. bp-templates/bp-legacy/buddypress/groups/single/home.php +19 -28
  255. bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php +4 -12
  256. bp-templates/bp-legacy/buddypress/groups/single/members.php +6 -16
  257. bp-templates/bp-legacy/buddypress/groups/single/plugins.php +3 -9
  258. bp-templates/bp-legacy/buddypress/groups/single/request-membership.php +3 -9
  259. bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php +2 -12
  260. bp-templates/bp-legacy/buddypress/groups/single/send-invites.php +2 -8
  261. bp-templates/bp-legacy/buddypress/members/activate.php +4 -14
  262. bp-templates/bp-legacy/buddypress/members/index.php +13 -19
  263. bp-templates/bp-legacy/buddypress/members/members-loop.php +11 -6
  264. bp-templates/bp-legacy/buddypress/members/register.php +32 -53
  265. bp-templates/bp-legacy/buddypress/members/single/activity.php +6 -5
  266. bp-templates/bp-legacy/buddypress/members/single/blogs.php +4 -3
  267. bp-templates/bp-legacy/buddypress/members/single/cover-image-header.php +0 -103
  268. bp-templates/bp-legacy/buddypress/members/single/forums.php +4 -3
  269. bp-templates/bp-legacy/buddypress/members/single/forums/topics.php +3 -4
  270. bp-templates/bp-legacy/buddypress/members/single/friends.php +4 -3
  271. bp-templates/bp-legacy/buddypress/members/single/friends/requests.php +13 -19
  272. bp-templates/bp-legacy/buddypress/members/single/groups.php +4 -3
  273. bp-templates/bp-legacy/buddypress/members/single/groups/invites.php +4 -10
  274. bp-templates/bp-legacy/buddypress/members/single/home.php +6 -25
  275. bp-templates/bp-legacy/buddypress/members/single/member-header.php +6 -5
  276. bp-templates/bp-legacy/buddypress/members/single/messages.php +5 -4
  277. bp-templates/bp-legacy/buddypress/members/single/messages/compose.php +4 -13
  278. bp-templates/bp-legacy/buddypress/members/single/messages/message.php +0 -86
  279. bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php +10 -16
  280. bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php +6 -12
  281. bp-templates/bp-legacy/buddypress/members/single/messages/single.php +65 -19
  282. bp-templates/bp-legacy/buddypress/members/single/notifications.php +4 -1
  283. bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php +2 -11
  284. bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php +2 -11
  285. bp-templates/bp-legacy/buddypress/members/single/notifications/read.php +1 -11
  286. bp-templates/bp-legacy/buddypress/members/single/notifications/unread.php +1 -11
  287. bp-templates/bp-legacy/buddypress/members/single/plugins.php +9 -9
  288. bp-templates/bp-legacy/buddypress/members/single/profile.php +3 -7
  289. bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php +5 -16
  290. bp-templates/bp-legacy/buddypress/members/single/profile/change-cover-image.php +0 -33
  291. bp-templates/bp-legacy/buddypress/members/single/profile/edit.php +6 -23
  292. bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php +1 -7
  293. bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php +5 -11
  294. bp-templates/bp-legacy/buddypress/members/single/settings.php +1 -0
  295. bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php +3 -9
  296. bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php +3 -9
  297. bp-templates/bp-legacy/buddypress/members/single/settings/general.php +2 -9
  298. bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php +3 -9
  299. bp-templates/bp-legacy/buddypress/members/single/settings/profile.php +4 -10
  300. bp-templates/bp-legacy/css/buddypress-rtl.css +11 -85
  301. bp-templates/bp-legacy/css/buddypress-rtl.min.css +1 -1
  302. bp-templates/bp-legacy/css/buddypress.css +11 -85
  303. bp-templates/bp-legacy/css/buddypress.min.css +1 -1
  304. bp-templates/bp-legacy/css/twentyfifteen-rtl.css +214 -201
  305. bp-templates/bp-legacy/css/twentyfifteen-rtl.min.css +1 -1
  306. bp-templates/bp-legacy/css/twentyfifteen.css +214 -201
  307. bp-templates/bp-legacy/css/twentyfifteen.min.css +1 -1
  308. bp-templates/bp-legacy/css/twentyfifteen.scss +2297 -2307
  309. bp-templates/bp-legacy/css/twentyfourteen-rtl.css +18 -4
  310. bp-templates/bp-legacy/css/twentyfourteen-rtl.min.css +1 -1
  311. bp-templates/bp-legacy/css/twentyfourteen.css +18 -4
  312. bp-templates/bp-legacy/css/twentyfourteen.min.css +1 -1
  313. bp-templates/bp-legacy/css/twentyfourteen.scss +13 -1
  314. bp-templates/bp-legacy/css/twentysixteen-rtl.css +0 -1861
  315. bp-templates/bp-legacy/css/twentysixteen-rtl.min.css +0 -1
  316. bp-templates/bp-legacy/css/twentysixteen.css +0 -1861
  317. bp-templates/bp-legacy/css/twentysixteen.min.css +0 -1
  318. bp-templates/bp-legacy/css/twentysixteen.scss +0 -2352
  319. bp-templates/bp-legacy/css/twentythirteen-rtl.css +0 -1936
  320. bp-templates/bp-legacy/css/twentythirteen-rtl.min.css +0 -1
  321. bp-templates/bp-legacy/css/twentythirteen.css +0 -1936
  322. bp-templates/bp-legacy/css/twentythirteen.min.css +0 -1
  323. bp-templates/bp-legacy/css/twentythirteen.scss +0 -2375
  324. bp-templates/bp-legacy/js/buddypress.js +47 -83
  325. bp-templates/bp-legacy/js/buddypress.min.js +3 -3
  326. bp-templates/bp-legacy/js/password-verify.min.js +1 -1
  327. bp-themes/bp-default/members/single/profile/edit.php +0 -7
  328. bp-themes/bp-default/registration/register.php +0 -7
  329. bp-themes/bp-default/rtl.css +1 -1
  330. bp-themes/bp-default/style.css +1 -1
  331. bp-xprofile/admin/css/admin-rtl.css +0 -10
  332. bp-xprofile/admin/css/admin-rtl.min.css +1 -1
  333. bp-xprofile/admin/css/admin.css +0 -10
  334. bp-xprofile/admin/css/admin.min.css +1 -1
  335. bp-xprofile/admin/js/admin.js +0 -34
  336. bp-xprofile/admin/js/admin.min.js +2 -2
  337. bp-xprofile/bp-xprofile-actions.php +21 -22
  338. bp-xprofile/bp-xprofile-activity.php +73 -83
  339. bp-xprofile/bp-xprofile-admin.php +136 -180
  340. bp-xprofile/bp-xprofile-cache.php +49 -88
  341. bp-xprofile/bp-xprofile-caps.php +20 -21
  342. bp-xprofile/bp-xprofile-classes.php +2 -2
  343. bp-xprofile/bp-xprofile-cssjs.php +8 -7
  344. bp-xprofile/bp-xprofile-filters.php +79 -137
  345. bp-xprofile/bp-xprofile-functions.php +178 -250
  346. bp-xprofile/bp-xprofile-loader.php +67 -97
  347. bp-xprofile/bp-xprofile-notifications.php +0 -49
  348. bp-xprofile/bp-xprofile-screens.php +60 -95
  349. bp-xprofile/bp-xprofile-settings.php +10 -18
  350. bp-xprofile/bp-xprofile-template.php +214 -256
  351. bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php +23 -28
  352. bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php +27 -44
  353. bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php +21 -33
  354. bp-xprofile/classes/class-bp-xprofile-field-type-number.php +16 -21
  355. bp-xprofile/classes/class-bp-xprofile-field-type-placeholder.php +9 -15
  356. bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php +20 -25
  357. bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php +22 -28
  358. bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php +31 -94
  359. bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php +17 -21
  360. bp-xprofile/classes/class-bp-xprofile-field-type-url.php +21 -29
  361. bp-xprofile/classes/class-bp-xprofile-field-type.php +58 -96
  362. bp-xprofile/classes/class-bp-xprofile-field.php +195 -678
  363. bp-xprofile/classes/class-bp-xprofile-group.php +150 -207
  364. bp-xprofile/classes/class-bp-xprofile-meta-query.php +19 -16
  365. bp-xprofile/classes/class-bp-xprofile-profiledata.php +36 -40
  366. bp-xprofile/classes/class-bp-xprofile-query.php +35 -30
  367. buddypress.pot +2154 -2415
  368. readme.txt +4 -34
bp-activity/admin/css/admin-rtl.css CHANGED
@@ -44,7 +44,6 @@
44
}
45
#bp-activities-form .column-response img {
46
float: right;
47
- margin-bottom: 5px;
48
margin-left: 10px;
49
margin-top: 1px;
50
}
@@ -79,9 +78,3 @@
79
.column-action {
80
width: 12%;
81
}
82
-
83
- @media screen and (max-width: 782px) {
84
- body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column) {
85
- display: table-cell;
86
- }
87
- }
44
}
45
#bp-activities-form .column-response img {
46
float: right;
47
margin-left: 10px;
48
margin-top: 1px;
49
}
78
.column-action {
79
width: 12%;
80
}
bp-activity/admin/css/admin-rtl.min.css CHANGED
@@ -1 +1 @@
1
- .akismet-status{float:left}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:left;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:right;margin-bottom:5px;margin-left:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-right:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}@media screen and (max-width:782px){body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){display:table-cell}}
1
+ .akismet-status{float:left}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:left;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:right;margin-left:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-right:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}
bp-activity/admin/css/admin.css CHANGED
@@ -44,7 +44,6 @@
44
}
45
#bp-activities-form .column-response img {
46
float: left;
47
- margin-bottom: 5px;
48
margin-right: 10px;
49
margin-top: 1px;
50
}
@@ -79,9 +78,3 @@
79
.column-action {
80
width: 12%;
81
}
82
-
83
- @media screen and (max-width: 782px) {
84
- body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column) {
85
- display: table-cell;
86
- }
87
- }
44
}
45
#bp-activities-form .column-response img {
46
float: left;
47
margin-right: 10px;
48
margin-top: 1px;
49
}
78
.column-action {
79
width: 12%;
80
}
bp-activity/admin/css/admin.min.css CHANGED
@@ -1 +1 @@
1
- .akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-bottom:5px;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}@media screen and (max-width:782px){body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){display:table-cell}}
1
+ .akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}
bp-activity/admin/js/admin.js CHANGED
@@ -4,14 +4,14 @@
4
/**
5
* Activity reply object for the activity index screen
6
*
7
- * @since 1.6.0
8
*/
9
var activityReply = {
10
11
/**
12
* Attach event handler functions to the relevant elements.
13
*
14
- * @since 1.6.0
15
*/
16
init : function() {
17
$(document).on( 'click', '.row-actions a.reply', activityReply.open );
@@ -29,7 +29,7 @@ var activityReply = {
29
/**
30
* Reveals the entire row when "reply" is pressed.
31
*
32
- * @since 1.6.0
33
*/
34
open : function() {
35
// Hide the container row, and move it to the new location
@@ -46,7 +46,7 @@ var activityReply = {
46
/**
47
* Hide and reset the entire row when "cancel", or escape, are pressed.
48
*
49
- * @since 1.6.0
50
*/
51
close : function() {
52
// Hide the container row
@@ -66,7 +66,7 @@ var activityReply = {
66
/**
67
* Submits "form" via AJAX back to WordPress.
68
*
69
- * @since 1.6.0
70
*/
71
send : function() {
72
// Hide any existing error message, and show the loading spinner
@@ -100,7 +100,7 @@ var activityReply = {
100
/**
101
* send() error message handler
102
*
103
- * @since 1.6.0
104
*/
105
error : function( r ) {
106
var er = r.statusText;
@@ -118,7 +118,7 @@ var activityReply = {
118
/**
119
* send() success handler
120
*
121
- * @since 1.6.0
122
*/
123
show : function ( xml ) {
124
var bg, id, response;
4
/**
5
* Activity reply object for the activity index screen
6
*
7
+ * @since BuddyPress (1.6)
8
*/
9
var activityReply = {
10
11
/**
12
* Attach event handler functions to the relevant elements.
13
*
14
+ * @since BuddyPress (1.6)
15
*/
16
init : function() {
17
$(document).on( 'click', '.row-actions a.reply', activityReply.open );
29
/**
30
* Reveals the entire row when "reply" is pressed.
31
*
32
+ * @since BuddyPress (1.6)
33
*/
34
open : function() {
35
// Hide the container row, and move it to the new location
46
/**
47
* Hide and reset the entire row when "cancel", or escape, are pressed.
48
*
49
+ * @since BuddyPress (1.6)
50
*/
51
close : function() {
52
// Hide the container row
66
/**
67
* Submits "form" via AJAX back to WordPress.
68
*
69
+ * @since BuddyPress (1.6)
70
*/
71
send : function() {
72
// Hide any existing error message, and show the loading spinner
100
/**
101
* send() error message handler
102
*
103
+ * @since BuddyPress (1.6)
104
*/
105
error : function( r ) {
106
var er = r.statusText;
118
/**
119
* send() success handler
120
*
121
+ * @since BuddyPress (1.6)
122
*/
123
show : function ( xml ) {
124
var bg, id, response;
bp-activity/admin/js/admin.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-11-11 6:41:29 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){var b={init:function(){a(document).on("click",".row-actions a.reply",b.open),a(document).on("click","#bp-activities-container a.cancel",b.close),a(document).on("click","#bp-activities-container a.save",b.send),a(document).on("keyup","#bp-activities:visible",function(a){27===a.which&&b.close()})},open:function(){var b=a("#bp-activities-container").hide();return a(this).parents("tr").after(b),b.fadeIn("300"),a("#bp-activities").focus(),!1},close:function(){return a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide()}),!1},send:function(){a("#bp-replysubmit .error").hide(),a("#bp-replysubmit .waiting").show();var c={};return c["_ajax_nonce-bp-activity-admin-reply"]=a('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),c.action="bp-activity-admin-reply",c.content=a("#bp-activities").val(),c.parent_id=a("#bp-activities-container").prev().data("parent_id"),c.root_id=a("#bp-activities-container").prev().data("root_id"),a.ajax({data:c,type:"POST",url:ajaxurl,error:function(a){b.error(a)},success:function(a){b.show(a)}}),!1},error:function(b){var c=b.statusText;a("#bp-replysubmit .waiting").hide(),b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&a("#bp-replysubmit .error").html(c).show()},show:function(c){var d,e,f;return"string"==typeof c?(b.error({responseText:c}),!1):(f=wpAjax.parseAjaxResponse(c),f.errors?(b.error({responseText:wpAjax.broken}),!1):(f=f.responses[0],void a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide(),a("#bp-activities-container").before(f.data),e=a("#activity-"+f.id),d=e.closest(".widefat").css("backgroundColor"),e.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:d},300)})))}};a(document).ready(function(){b.init(),a("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
1
+ /*! buddypress - v2.3.1 - 2015-06-05 1:24:19 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){var b={init:function(){a(document).on("click",".row-actions a.reply",b.open),a(document).on("click","#bp-activities-container a.cancel",b.close),a(document).on("click","#bp-activities-container a.save",b.send),a(document).on("keyup","#bp-activities:visible",function(a){27===a.which&&b.close()})},open:function(){var b=a("#bp-activities-container").hide();return a(this).parents("tr").after(b),b.fadeIn("300"),a("#bp-activities").focus(),!1},close:function(){return a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide()}),!1},send:function(){a("#bp-replysubmit .error").hide(),a("#bp-replysubmit .waiting").show();var c={};return c["_ajax_nonce-bp-activity-admin-reply"]=a('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),c.action="bp-activity-admin-reply",c.content=a("#bp-activities").val(),c.parent_id=a("#bp-activities-container").prev().data("parent_id"),c.root_id=a("#bp-activities-container").prev().data("root_id"),a.ajax({data:c,type:"POST",url:ajaxurl,error:function(a){b.error(a)},success:function(a){b.show(a)}}),!1},error:function(b){var c=b.statusText;a("#bp-replysubmit .waiting").hide(),b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&a("#bp-replysubmit .error").html(c).show()},show:function(c){var d,e,f;return"string"==typeof c?(b.error({responseText:c}),!1):(f=wpAjax.parseAjaxResponse(c),f.errors?(b.error({responseText:wpAjax.broken}),!1):(f=f.responses[0],void a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide(),a("#bp-activities-container").before(f.data),e=a("#activity-"+f.id),d=e.closest(".widefat").css("backgroundColor"),e.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:d},300)})))}};a(document).ready(function(){b.init(),a("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
bp-activity/bp-activity-actions.php CHANGED
@@ -1,4 +1,5 @@
1
<?php
2
/**
3
* Action functions are exactly the same as screen functions, however they do
4
* not have a template screen associated with them. Usually they will send the
@@ -8,13 +9,13 @@
8
* @subpackage ActivityActions
9
*/
10
11
- // Exit if accessed directly.
12
defined( 'ABSPATH' ) || exit;
13
14
/**
15
* Allow core components and dependent plugins to register activity actions.
16
*
17
- * @since 1.2.0
18
*
19
* @uses do_action() To call 'bp_register_activity_actions' hook.
20
*/
@@ -23,7 +24,7 @@ function bp_register_activity_actions() {
23
/**
24
* Fires on bp_init to allow core components and dependent plugins to register activity actions.
25
*
26
- * @since 1.2.0
27
*/
28
do_action( 'bp_register_activity_actions' );
29
}
@@ -32,7 +33,7 @@ add_action( 'bp_init', 'bp_register_activity_actions', 8 );
32
/**
33
* Catch and route requests for single activity item permalinks.
34
*
35
- * @since 1.2.0
36
*
37
* @uses bp_is_activity_component()
38
* @uses bp_is_current_action()
@@ -50,15 +51,15 @@ add_action( 'bp_init', 'bp_register_activity_actions', 8 );
50
*/
51
function bp_activity_action_permalink_router() {
52
53
- // Not viewing activity.
54
if ( ! bp_is_activity_component() || ! bp_is_current_action( 'p' ) )
55
return false;
56
57
- // No activity to display.
58
if ( ! bp_action_variable( 0 ) || ! is_numeric( bp_action_variable( 0 ) ) )
59
return false;
60
61
- // Get the activity details.
62
$activity = bp_activity_get_specific( array( 'activity_ids' => bp_action_variable( 0 ), 'show_hidden' => true ) );
63
64
// 404 if activity does not exist
@@ -69,31 +70,31 @@ function bp_activity_action_permalink_router() {
69
$activity = $activity['activities'][0];
70
}
71
72
- // Do not redirect at default.
73
$redirect = false;
74
75
- // Redirect based on the type of activity.
76
if ( bp_is_active( 'groups' ) && $activity->component == buddypress()->groups->id ) {
77
78
- // Activity is a user update.
79
if ( ! empty( $activity->user_id ) ) {
80
$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
81
82
- // Activity is something else.
83
} else {
84
85
- // Set redirect to group activity stream.
86
if ( $group = groups_get_group( array( 'group_id' => $activity->item_id ) ) ) {
87
$redirect = bp_get_group_permalink( $group ) . bp_get_activity_slug() . '/' . $activity->id . '/';
88
}
89
}
90
91
- // Set redirect to users' activity stream.
92
} elseif ( ! empty( $activity->user_id ) ) {
93
$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
94
}
95
96
- // If set, add the original query string back onto the redirect URL.
97
if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {
98
$query_frags = array();
99
wp_parse_str( $_SERVER['QUERY_STRING'], $query_frags );
@@ -103,7 +104,7 @@ function bp_activity_action_permalink_router() {
103
/**
104
* Filter the intended redirect url before the redirect occurs for the single activity item.
105
*
106
- * @since 1.2.2
107
*
108
* @param array Array with url to redirect to and activity related to the redirect.
109
*/
@@ -111,7 +112,7 @@ function bp_activity_action_permalink_router() {
111
bp_core_redirect( bp_get_root_domain() );
112
}
113
114
- // Redirect to the actual activity permalink page.
115
bp_core_redirect( $redirect );
116
}
117
add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
@@ -119,7 +120,9 @@ add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
119
/**
120
* Delete specific activity item and redirect to previous page.
121
*
122
- * @since 1.1.0
123
*
124
* @uses bp_is_activity_component()
125
* @uses bp_is_current_action()
@@ -132,43 +135,42 @@ add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
132
* @uses do_action() Calls 'bp_activity_action_delete_activity' hook to allow actions to be taken after the activity is deleted.
133
* @uses bp_core_redirect()
134
*
135
- * @param int $activity_id Activity id to be deleted. Defaults to 0.
136
* @return bool False on failure.
137
*/
138
function bp_activity_action_delete_activity( $activity_id = 0 ) {
139
140
- // Not viewing activity or action is not delete.
141
if ( !bp_is_activity_component() || !bp_is_current_action( 'delete' ) )
142
return false;
143
144
if ( empty( $activity_id ) && bp_action_variable( 0 ) )
145
$activity_id = (int) bp_action_variable( 0 );
146
147
- // Not viewing a specific activity item.
148
if ( empty( $activity_id ) )
149
return false;
150
151
- // Check the nonce.
152
check_admin_referer( 'bp_activity_delete_link' );
153
154
- // Load up the activity item.
155
$activity = new BP_Activity_Activity( $activity_id );
156
157
- // Check access.
158
if ( ! bp_activity_user_can_delete( $activity ) )
159
return false;
160
161
/**
162
* Fires before the deletion so plugins can still fetch information about it.
163
*
164
- * @since 1.5.0
165
*
166
* @param int $activity_id The activity ID.
167
* @param int $user_id The user associated with the activity.
168
*/
169
do_action( 'bp_activity_before_action_delete_activity', $activity_id, $activity->user_id );
170
171
- // Delete the activity item and provide user feedback.
172
if ( bp_activity_delete( array( 'id' => $activity_id, 'user_id' => $activity->user_id ) ) )
173
bp_core_add_message( __( 'Activity deleted successfully', 'buddypress' ) );
174
else
@@ -177,14 +179,14 @@ function bp_activity_action_delete_activity( $activity_id = 0 ) {
177
/**
178
* Fires after the deletion so plugins can act afterwards based on the activity.
179
*
180
- * @since 1.1.0
181
*
182
* @param int $activity_id The activity ID.
183
* @param int $user_id The user associated with the activity.
184
*/
185
do_action( 'bp_activity_action_delete_activity', $activity_id, $activity->user_id );
186
187
- // Check for the redirect query arg, otherwise let WP handle things.
188
if ( !empty( $_GET['redirect_to'] ) )
189
bp_core_redirect( esc_url( $_GET['redirect_to'] ) );
190
else
@@ -195,22 +197,23 @@ add_action( 'bp_actions', 'bp_activity_action_delete_activity' );
195
/**
196
* Mark specific activity item as spam and redirect to previous page.
197
*
198
- * @since 1.6.0
199
*
200
* @param int $activity_id Activity id to be deleted. Defaults to 0.
201
* @return bool False on failure.
202
*/
203
function bp_activity_action_spam_activity( $activity_id = 0 ) {
204
$bp = buddypress();
205
206
- // Not viewing activity, or action is not spam, or Akismet isn't present.
207
if ( !bp_is_activity_component() || !bp_is_current_action( 'spam' ) || empty( $bp->activity->akismet ) )
208
return false;
209
210
if ( empty( $activity_id ) && bp_action_variable( 0 ) )
211
$activity_id = (int) bp_action_variable( 0 );
212
213
- // Not viewing a specific activity item.
214
if ( empty( $activity_id ) )
215
return false;
216
@@ -218,42 +221,42 @@ function bp_activity_action_spam_activity( $activity_id = 0 ) {
218
if ( !bp_activity_user_can_mark_spam() )
219
return false;
220
221
- // Load up the activity item.
222
$activity = new BP_Activity_Activity( $activity_id );
223
if ( empty( $activity->id ) )
224
return false;
225
226
- // Check nonce.
227
check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id );
228
229
/**
230
* Fires before the marking activity as spam so plugins can modify things if they want to.
231
*
232
- * @since 1.6.0
233
*
234
* @param int $activity_id Activity ID to be marked as spam.
235
* @param object $activity Activity object for the ID to be marked as spam.
236
*/
237
do_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity );
238
239
- // Mark as spam.
240
bp_activity_mark_as_spam( $activity );
241
$activity->save();
242
243
- // Tell the user the spamming has been successful.
244
bp_core_add_message( __( 'The activity item has been marked as spam and is no longer visible.', 'buddypress' ) );
245
246
/**
247
* Fires after the marking activity as spam so plugins can act afterwards based on the activity.
248
*
249
- * @since 1.6.0
250
*
251
* @param int $activity_id Activity ID that was marked as spam.
252
* @param int $user_id User ID associated with activity.
253
*/
254
do_action( 'bp_activity_action_spam_activity', $activity_id, $activity->user_id );
255
256
- // Check for the redirect query arg, otherwise let WP handle things.
257
if ( !empty( $_GET['redirect_to'] ) )
258
bp_core_redirect( esc_url( $_GET['redirect_to'] ) );
259
else
@@ -264,7 +267,7 @@ add_action( 'bp_actions', 'bp_activity_action_spam_activity' );
264
/**
265
* Post user/group activity update.
266
*
267
- * @since 1.2.0
268
*
269
* @uses is_user_logged_in()
270
* @uses bp_is_activity_component()
@@ -284,17 +287,17 @@ add_action( 'bp_actions', 'bp_activity_action_spam_activity' );
284
*/
285
function bp_activity_action_post_update() {
286
287
- // Do not proceed if user is not logged in, not viewing activity, or not posting.
288
if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'post' ) )
289
return false;
290
291
- // Check the nonce.
292
check_admin_referer( 'post_update', '_wpnonce_post_update' );
293
294
/**
295
* Filters the content provided in the activity input field.
296
*
297
- * @since 1.2.0
298
*
299
* @param string $value Activity message being posted.
300
*/
@@ -305,7 +308,7 @@ function bp_activity_action_post_update() {
305
/**
306
* Filters the item type that the activity update should be associated with.
307
*
308
- * @since 1.2.0
309
*
310
* @param string $value Item type to associate with.
311
*/
@@ -317,24 +320,24 @@ function bp_activity_action_post_update() {
317
/**
318
* Filters what component the activity is being to.
319
*
320
- * @since 1.2.0
321
*
322
* @param string $value Chosen component to post activity to.
323
*/
324
$item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in'] );
325
}
326
327
- // No activity content so provide feedback and redirect.
328
if ( empty( $content ) ) {
329
bp_core_add_message( __( 'Please enter some content to post.', 'buddypress' ), 'error' );
330
bp_core_redirect( wp_get_referer() );
331
}
332
333
- // No existing item_id.
334
if ( empty( $item_id ) ) {
335
$activity_id = bp_activity_post_update( array( 'content' => $content ) );
336
337
- // Post to groups object.
338
} elseif ( 'groups' == $object && bp_is_active( 'groups' ) ) {
339
if ( (int) $item_id ) {
340
$activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) );
@@ -345,7 +348,7 @@ function bp_activity_action_post_update() {
345
/**
346
* Filters activity object for BuddyPress core and plugin authors before posting activity update.
347
*
348
- * @since 1.2.0
349
*
350
* @param string $object Activity item being associated to.
351
* @param string $item_id Component ID being posted to.
@@ -354,13 +357,13 @@ function bp_activity_action_post_update() {
354
$activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );
355
}
356
357
- // Provide user feedback.
358
if ( !empty( $activity_id ) )
359
bp_core_add_message( __( 'Update Posted!', 'buddypress' ) );
360
else
361
bp_core_add_message( __( 'There was an error when posting your update. Please try again.', 'buddypress' ), 'error' );
362
363
- // Redirect.
364
bp_core_redirect( wp_get_referer() );
365
}
366
add_action( 'bp_actions', 'bp_activity_action_post_update' );
@@ -368,7 +371,7 @@ add_action( 'bp_actions', 'bp_activity_action_post_update' );
368
/**
369
* Post new activity comment.
370
*
371
- * @since 1.2.0
372
*
373
* @uses is_user_logged_in()
374
* @uses bp_is_activity_component()
@@ -388,13 +391,13 @@ function bp_activity_action_post_comment() {
388
if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'reply' ) )
389
return false;
390
391
- // Check the nonce.
392
check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );
393
394
/**
395
* Filters the activity ID a comment will be in reply to.
396
*
397
- * @since 1.2.0
398
*
399
* @param string $value ID of the activity being replied to.
400
*/
@@ -403,7 +406,7 @@ function bp_activity_action_post_comment() {
403
/**
404
* Filters the comment content for a comment reply.
405
*
406
- * @since 1.2.0
407
*
408
* @param string $value Comment content being posted.
409
*/
@@ -432,7 +435,7 @@ add_action( 'bp_actions', 'bp_activity_action_post_comment' );
432
/**
433
* Mark activity as favorite.
434
*
435
- * @since 1.2.0
436
*
437
* @uses is_user_logged_in()
438
* @uses bp_is_activity_component()
@@ -451,7 +454,7 @@ function bp_activity_action_mark_favorite() {
451
if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'favorite' ) )
452
return false;
453
454
- // Check the nonce.
455
check_admin_referer( 'mark_favorite' );
456
457
if ( bp_activity_add_user_favorite( bp_action_variable( 0 ) ) )
@@ -466,7 +469,7 @@ add_action( 'bp_actions', 'bp_activity_action_mark_favorite' );
466
/**
467
* Remove activity from favorites.
468
*
469
- * @since 1.2.0
470
*
471
* @uses is_user_logged_in()
472
* @uses bp_is_activity_component()
@@ -485,7 +488,7 @@ function bp_activity_action_remove_favorite() {
485
if ( ! is_user_logged_in() || ! bp_is_activity_component() || ! bp_is_current_action( 'unfavorite' ) )
486
return false;
487
488
- // Check the nonce.
489
check_admin_referer( 'unmark_favorite' );
490
491
if ( bp_activity_remove_user_favorite( bp_action_variable( 0 ) ) )
@@ -500,7 +503,7 @@ add_action( 'bp_actions', 'bp_activity_action_remove_favorite' );
500
/**
501
* Load the sitewide activity feed.
502
*
503
- * @since 1.0.0
504
*
505
* @uses bp_is_activity_component()
506
* @uses bp_is_current_action()
@@ -515,7 +518,7 @@ function bp_activity_action_sitewide_feed() {
515
if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) )
516
return false;
517
518
- // Setup the feed.
519
buddypress()->activity->feed = new BP_Activity_Feed( array(
520
'id' => 'sitewide',
521
@@ -532,7 +535,7 @@ add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
532
/**
533
* Load a user's personal activity feed.
534
*
535
- * @since 1.0.0
536
*
537
* @uses bp_is_user_activity()
538
* @uses bp_is_current_action()
@@ -545,7 +548,7 @@ function bp_activity_action_personal_feed() {
545
return false;
546
}
547
548
- // Setup the feed.
549
buddypress()->activity->feed = new BP_Activity_Feed( array(
550
'id' => 'personal',
551
@@ -562,7 +565,7 @@ add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
562
/**
563
* Load a user's friends' activity feed.
564
*
565
- * @since 1.0.0
566
*
567
* @uses bp_is_active()
568
* @uses bp_is_user_activity()
@@ -578,7 +581,7 @@ function bp_activity_action_friends_feed() {
578
return false;
579
}
580
581
- // Setup the feed.
582
buddypress()->activity->feed = new BP_Activity_Feed( array(
583
'id' => 'friends',
584
@@ -595,7 +598,7 @@ add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
595
/**
596
* Load the activity feed for a user's groups.
597
*
598
- * @since 1.2.0
599
*
600
* @uses bp_is_active()
601
* @uses bp_is_user_activity()
@@ -611,11 +614,11 @@ function bp_activity_action_my_groups_feed() {
611
return false;
612
}
613
614
- // Get displayed user's group IDs.
615
$groups = groups_get_user_groups();
616
$group_ids = implode( ',', $groups['groups'] );
617
618
- // Setup the feed.
619
buddypress()->activity->feed = new BP_Activity_Feed( array(
620
'id' => 'mygroups',
621
@@ -636,7 +639,7 @@ add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
636
/**
637
* Load a user's @mentions feed.
638
*
639
- * @since 1.2.0
640
*
641
* @uses bp_is_user_activity()
642
* @uses bp_is_current_action()
@@ -654,7 +657,7 @@ function bp_activity_action_mentions_feed() {
654
return false;
655
}
656
657
- // Setup the feed.
658
buddypress()->activity->feed = new BP_Activity_Feed( array(
659
'id' => 'mentions',
660
@@ -673,7 +676,7 @@ add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
673
/**
674
* Load a user's favorites feed.
675
*
676
- * @since 1.2.0
677
*
678
* @uses bp_is_user_activity()
679
* @uses bp_is_current_action()
@@ -687,11 +690,11 @@ function bp_activity_action_favorites_feed() {
687
return false;
688
}
689
690
- // Get displayed user's favorite activity IDs.
691
$favs = bp_activity_get_user_favorites( bp_displayed_user_id() );
692
$fav_ids = implode( ',', (array) $favs );
693
694
- // Setup the feed.
695
buddypress()->activity->feed = new BP_Activity_Feed( array(
696
'id' => 'favorites',
697
@@ -708,23 +711,23 @@ add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
708
/**
709
* Loads Akismet filtering for activity.
710
*
711
- * @since 1.6.0
712
- * @since 2.3.0 We only support Akismet 3+.
713
*/
714
function bp_activity_setup_akismet() {
715
$bp = buddypress();
716
717
- // Bail if Akismet is not active.
718
if ( ! defined( 'AKISMET_VERSION' ) ) {
719
return;
720
}
721
722
- // Bail if older version of Akismet.
723
if ( ! class_exists( 'Akismet' ) ) {
724
return;
725
}
726
727
- // Bail if no Akismet key is set.
728
if ( ! bp_get_option( 'wordpress_api_key' ) && ! defined( 'WPCOM_API_KEY' ) ) {
729
return;
730
}
@@ -732,7 +735,7 @@ function bp_activity_setup_akismet() {
732
/**
733
* Filters if BuddyPress Activity Akismet support has been disabled by another plugin.
734
*
735
- * @since 1.6.0
736
*
737
* @param bool $value Return value of bp_is_akismet_active boolean function.
738
*/
@@ -740,14 +743,14 @@ function bp_activity_setup_akismet() {
740
return;
741
}
742
743
- // Instantiate Akismet for BuddyPress.
744
$bp->activity->akismet = new BP_Akismet();
745
}
746
747
/**
748
* AJAX endpoint for Suggestions API lookups.
749
*
750
- * @since 2.1.0
751
*/
752
function bp_ajax_get_suggestions() {
753
if ( ! bp_is_user_active() || empty( $_GET['term'] ) || empty( $_GET['type'] ) ) {
@@ -779,7 +782,7 @@ add_action( 'wp_ajax_bp_get_suggestions', 'bp_ajax_get_suggestions' );
779
/**
780
* Detect a change in post type status, and initiate an activity update if necessary.
781
*
782
- * @since 2.2.0
783
*
784
* @todo Support untrashing better.
785
*
@@ -813,7 +816,7 @@ function bp_activity_catch_transition_post_type_status( $new_status, $old_status
813
* This is a variable filter that is dependent on the post type
814
* being untrashed.
815
*
816
- * @since 2.2.0
817
*
818
* @param WP_Post $post Post data.
819
*/
@@ -825,7 +828,7 @@ function bp_activity_catch_transition_post_type_status( $new_status, $old_status
825
826
// Unpublishing a previously published post.
827
} elseif ( 'publish' === $old_status ) {
828
- // Some form of pending status - only remove the activity entry.
829
bp_activity_post_type_unpublish( $post->ID, $post );
830
}
831
}
1
<?php
2
+
3
/**
4
* Action functions are exactly the same as screen functions, however they do
5
* not have a template screen associated with them. Usually they will send the
9
* @subpackage ActivityActions
10
*/
11
12
+ // Exit if accessed directly
13
defined( 'ABSPATH' ) || exit;
14
15
/**
16
* Allow core components and dependent plugins to register activity actions.
17
*
18
+ * @since BuddyPress (1.2.0)
19
*
20
* @uses do_action() To call 'bp_register_activity_actions' hook.
21
*/
24
/**
25
* Fires on bp_init to allow core components and dependent plugins to register activity actions.
26
*
27
+ * @since BuddyPress (1.2.0)
28
*/
29
do_action( 'bp_register_activity_actions' );
30
}
33
/**
34
* Catch and route requests for single activity item permalinks.
35
*
36
+ * @since BuddyPress (1.2.0)
37
*
38
* @uses bp_is_activity_component()
39
* @uses bp_is_current_action()
51
*/
52
function bp_activity_action_permalink_router() {
53
54
+ // Not viewing activity
55
if ( ! bp_is_activity_component() || ! bp_is_current_action( 'p' ) )
56
return false;
57
58
+ // No activity to display
59
if ( ! bp_action_variable( 0 ) || ! is_numeric( bp_action_variable( 0 ) ) )
60
return false;
61
62
+ // Get the activity details
63
$activity = bp_activity_get_specific( array( 'activity_ids' => bp_action_variable( 0 ), 'show_hidden' => true ) );
64
65
// 404 if activity does not exist
70
$activity = $activity['activities'][0];
71
}
72
73
+ // Do not redirect at default
74
$redirect = false;
75
76
+ // Redirect based on the type of activity
77
if ( bp_is_active( 'groups' ) && $activity->component == buddypress()->groups->id ) {
78
79
+ // Activity is a user update
80
if ( ! empty( $activity->user_id ) ) {
81
$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
82
83
+ // Activity is something else
84
} else {
85
86
+ // Set redirect to group activity stream
87
if ( $group = groups_get_group( array( 'group_id' => $activity->item_id ) ) ) {
88
$redirect = bp_get_group_permalink( $group ) . bp_get_activity_slug() . '/' . $activity->id . '/';
89
}
90
}
91
92
+ // Set redirect to users' activity stream
93
} elseif ( ! empty( $activity->user_id ) ) {
94
$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
95
}
96
97
+ // If set, add the original query string back onto the redirect URL
98
if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {
99
$query_frags = array();
100
wp_parse_str( $_SERVER['QUERY_STRING'], $query_frags );
104
/**
105
* Filter the intended redirect url before the redirect occurs for the single activity item.
106
*
107
+ * @since BuddyPress (1.2.2)
108
*
109
* @param array Array with url to redirect to and activity related to the redirect.
110
*/
112
bp_core_redirect( bp_get_root_domain() );
113
}
114
115
+ // Redirect to the actual activity permalink page
116
bp_core_redirect( $redirect );
117
}
118
add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
120
/**
121
* Delete specific activity item and redirect to previous page.
122
*
123
+ * @since BuddyPress (1.1.0)
124
+ *
125
+ * @param int $activity_id Activity id to be deleted. Defaults to 0.
126
*
127
* @uses bp_is_activity_component()
128
* @uses bp_is_current_action()
135
* @uses do_action() Calls 'bp_activity_action_delete_activity' hook to allow actions to be taken after the activity is deleted.
136
* @uses bp_core_redirect()
137
*
138
* @return bool False on failure.
139
*/
140
function bp_activity_action_delete_activity( $activity_id = 0 ) {
141
142
+ // Not viewing activity or action is not delete
143
if ( !bp_is_activity_component() || !bp_is_current_action( 'delete' ) )
144
return false;
145
146
if ( empty( $activity_id ) && bp_action_variable( 0 ) )
147
$activity_id = (int) bp_action_variable( 0 );
148
149
+ // Not viewing a specific activity item
150
if ( empty( $activity_id ) )
151
return false;
152
153
+ // Check the nonce
154
check_admin_referer( 'bp_activity_delete_link' );
155
156
+ // Load up the activity item
157
$activity = new BP_Activity_Activity( $activity_id );
158
159
+ // Check access
160
if ( ! bp_activity_user_can_delete( $activity ) )
161
return false;
162
163
/**
164
* Fires before the deletion so plugins can still fetch information about it.
165
*
166
+ * @since BuddyPress (1.5.0)
167
*
168
* @param int $activity_id The activity ID.
169
* @param int $user_id The user associated with the activity.
170
*/
171
do_action( 'bp_activity_before_action_delete_activity', $activity_id, $activity->user_id );
172
173
+ // Delete the activity item and provide user feedback
174
if ( bp_activity_delete( array( 'id' => $activity_id, 'user_id' => $activity->user_id ) ) )
175
bp_core_add_message( __( 'Activity deleted successfully', 'buddypress' ) );
176
else
179
/**
180
* Fires after the deletion so plugins can act afterwards based on the activity.
181
*
182
+ * @since BuddyPress (1.1.0)
183
*
184
* @param int $activity_id The activity ID.
185
* @param int $user_id The user associated with the activity.
186
*/
187
do_action( 'bp_activity_action_delete_activity', $activity_id, $activity->user_id );
188
189
+ // Check for the redirect query arg, otherwise let WP handle things
190
if ( !empty( $_GET['redirect_to'] ) )
191
bp_core_redirect( esc_url( $_GET['redirect_to'] ) );
192
else
197
/**
198
* Mark specific activity item as spam and redirect to previous page.
199
*
200
+ * @since BuddyPress (1.6.0)
201
*
202
* @param int $activity_id Activity id to be deleted. Defaults to 0.
203
+ *
204
* @return bool False on failure.
205
*/
206
function bp_activity_action_spam_activity( $activity_id = 0 ) {
207
$bp = buddypress();
208
209
+ // Not viewing activity, or action is not spam, or Akismet isn't present
210
if ( !bp_is_activity_component() || !bp_is_current_action( 'spam' ) || empty( $bp->activity->akismet ) )
211
return false;
212
213
if ( empty( $activity_id ) && bp_action_variable( 0 ) )
214
$activity_id = (int) bp_action_variable( 0 );
215
216
+ // Not viewing a specific activity item
217
if ( empty( $activity_id ) )
218
return false;
219
221
if ( !bp_activity_user_can_mark_spam() )
222
return false;
223
224
+ // Load up the activity item
225
$activity = new BP_Activity_Activity( $activity_id );
226
if ( empty( $activity->id ) )
227
return false;
228
229
+ // Check nonce
230
check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id );
231
232
/**
233
* Fires before the marking activity as spam so plugins can modify things if they want to.
234
*
235
+ * @since BuddyPress (1.6.0)
236
*
237
* @param int $activity_id Activity ID to be marked as spam.
238
* @param object $activity Activity object for the ID to be marked as spam.
239
*/
240
do_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity );
241
242
+ // Mark as spam
243
bp_activity_mark_as_spam( $activity );
244
$activity->save();
245
246
+ // Tell the user the spamming has been successful
247
bp_core_add_message( __( 'The activity item has been marked as spam and is no longer visible.', 'buddypress' ) );
248
249
/**
250
* Fires after the marking activity as spam so plugins can act afterwards based on the activity.
251
*
252
+ * @since BuddyPress (1.6.0)
253
*
254
* @param int $activity_id Activity ID that was marked as spam.
255
* @param int $user_id User ID associated with activity.
256
*/
257
do_action( 'bp_activity_action_spam_activity', $activity_id, $activity->user_id );
258
259
+ // Check for the redirect query arg, otherwise let WP handle things
260
if ( !empty( $_GET['redirect_to'] ) )
261
bp_core_redirect( esc_url( $_GET['redirect_to'] ) );
262
else
267
/**
268
* Post user/group activity update.
269
*
270
+ * @since BuddyPress (1.2.0)
271
*
272
* @uses is_user_logged_in()
273
* @uses bp_is_activity_component()
287
*/
288
function bp_activity_action_post_update() {
289
290
+ // Do not proceed if user is not logged in, not viewing activity, or not posting
291
if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'post' ) )
292
return false;
293
294
+ // Check the nonce
295
check_admin_referer( 'post_update', '_wpnonce_post_update' );
296
297
/**
298
* Filters the content provided in the activity input field.
299
*
300
+ * @since BuddyPress (1.2.0)
301
*
302
* @param string $value Activity message being posted.
303
*/
308
/**
309
* Filters the item type that the activity update should be associated with.
310
*
311
+ * @since BuddyPress (1.2.0)
312
*
313
* @param string $value Item type to associate with.
314
*/
320
/**
321
* Filters what component the activity is being to.
322
*
323
+ * @since BuddyPress (1.2.0)
324
*
325
* @param string $value Chosen component to post activity to.
326
*/
327
$item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in'] );
328
}
329
330
+ // No activity content so provide feedback and redirect
331
if ( empty( $content ) ) {
332
bp_core_add_message( __( 'Please enter some content to post.', 'buddypress' ), 'error' );
333
bp_core_redirect( wp_get_referer() );
334
}
335
336
+ // No existing item_id
337
if ( empty( $item_id ) ) {
338
$activity_id = bp_activity_post_update( array( 'content' => $content ) );
339
340
+ // Post to groups object
341
} elseif ( 'groups' == $object && bp_is_active( 'groups' ) ) {
342
if ( (int) $item_id ) {
343
$activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) );
348
/**
349
* Filters activity object for BuddyPress core and plugin authors before posting activity update.
350
*
351
+ * @since BuddyPress (1.2.0)
352
*
353
* @param string $object Activity item being associated to.
354
* @param string $item_id Component ID being posted to.
357
$activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );
358
}
359
360
+ // Provide user feedback
361
if ( !empty( $activity_id ) )
362
bp_core_add_message( __( 'Update Posted!', 'buddypress' ) );
363
else
364
bp_core_add_message( __( 'There was an error when posting your update. Please try again.', 'buddypress' ), 'error' );
365
366
+ // Redirect
367
bp_core_redirect( wp_get_referer() );
368
}
369
add_action( 'bp_actions', 'bp_activity_action_post_update' );
371
/**
372
* Post new activity comment.
373
*
374
+ * @since BuddyPress (1.2.0)
375
*
376
* @uses is_user_logged_in()
377
* @uses bp_is_activity_component()
391
if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'reply' ) )
392
return false;
393
394
+ // Check the nonce
395
check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );
396
397
/**
398
* Filters the activity ID a comment will be in reply to.
399
*
400
+ * @since BuddyPress (1.2.0)
401
*
402
* @param string $value ID of the activity being replied to.
403
*/
406
/**
407
* Filters the comment content for a comment reply.
408
*
409
+ * @since BuddyPress (1.2.0)
410
*
411
* @param string $value Comment content being posted.
412
*/
435
/**
436
* Mark activity as favorite.
437
*
438
+ * @since BuddyPress (1.2.0)
439
*
440
* @uses is_user_logged_in()
441
* @uses bp_is_activity_component()
454
if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'favorite' ) )
455
return false;
456
457
+ // Check the nonce
458
check_admin_referer( 'mark_favorite' );
459
460
if ( bp_activity_add_user_favorite( bp_action_variable( 0 ) ) )
469
/**
470
* Remove activity from favorites.
471
*
472
+ * @since BuddyPress (1.2.0)
473
*
474
* @uses is_user_logged_in()
475
* @uses bp_is_activity_component()
488
if ( ! is_user_logged_in() || ! bp_is_activity_component() || ! bp_is_current_action( 'unfavorite' ) )
489
return false;
490
491
+ // Check the nonce
492
check_admin_referer( 'unmark_favorite' );
493
494
if ( bp_activity_remove_user_favorite( bp_action_variable( 0 ) ) )
503
/**
504
* Load the sitewide activity feed.
505
*
506
+ * @since BuddyPress (1.0.0)
507
*
508
* @uses bp_is_activity_component()
509
* @uses bp_is_current_action()
518
if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) )
519
return false;
520
521
+ // setup the feed
522
buddypress()->activity->feed = new BP_Activity_Feed( array(
523
'id' => 'sitewide',
524
535
/**
536
* Load a user's personal activity feed.
537
*
538
+ * @since BuddyPress (1.0.0)
539
*
540
* @uses bp_is_user_activity()
541
* @uses bp_is_current_action()
548
return false;
549
}
550
551
+ // setup the feed
552
buddypress()->activity->feed = new BP_Activity_Feed( array(
553
'id' => 'personal',
554
565
/**
566
* Load a user's friends' activity feed.
567
*
568
+ * @since BuddyPress (1.0.0)
569
*
570
* @uses bp_is_active()
571
* @uses bp_is_user_activity()
581
return false;
582
}
583
584
+ // setup the feed
585
buddypress()->activity->feed = new BP_Activity_Feed( array(
586
'id' => 'friends',
587
598
/**
599
* Load the activity feed for a user's groups.
600
*
601
+ * @since BuddyPress (1.2.0)
602
*
603
* @uses bp_is_active()
604
* @uses bp_is_user_activity()
614
return false;
615
}
616
617
+ // get displayed user's group IDs
618
$groups = groups_get_user_groups();
619
$group_ids = implode( ',', $groups['groups'] );
620
621
+ // setup the feed
622
buddypress()->activity->feed = new BP_Activity_Feed( array(
623
'id' => 'mygroups',
624
639
/**
640
* Load a user's @mentions feed.
641
*
642
+ * @since BuddyPress (1.2.0)
643
*
644
* @uses bp_is_user_activity()
645
* @uses bp_is_current_action()
657
return false;
658
}
659
660
+ // setup the feed
661
buddypress()->activity->feed = new BP_Activity_Feed( array(
662
'id' => 'mentions',
663
676
/**
677
* Load a user's favorites feed.
678
*
679
+ * @since BuddyPress (1.2.0)
680
*
681
* @uses bp_is_user_activity()
682
* @uses bp_is_current_action()
690
return false;
691
}
692
693
+ // get displayed user's favorite activity IDs
694
$favs = bp_activity_get_user_favorites( bp_displayed_user_id() );
695
$fav_ids = implode( ',', (array) $favs );
696
697
+ // setup the feed
698
buddypress()->activity->feed = new BP_Activity_Feed( array(
699
'id' => 'favorites',
700
711
/**
712
* Loads Akismet filtering for activity.
713
*
714
+ * @since BuddyPress (1.6.0)
715
+ * @since BuddyPress (2.3.0) We only support Akismet 3+.
716
*/
717
function bp_activity_setup_akismet() {
718
$bp = buddypress();
719
720
+ // Bail if Akismet is not active
721
if ( ! defined( 'AKISMET_VERSION' ) ) {
722
return;
723
}
724
725
+ // Bail if older version of Akismet
726
if ( ! class_exists( 'Akismet' ) ) {
727
return;
728
}
729
730
+ // Bail if no Akismet key is set
731
if ( ! bp_get_option( 'wordpress_api_key' ) && ! defined( 'WPCOM_API_KEY' ) ) {
732
return;
733
}
735
/**
736
* Filters if BuddyPress Activity Akismet support has been disabled by another plugin.
737
*
738
+ * @since BuddyPress (1.6.0)
739
*
740
* @param bool $value Return value of bp_is_akismet_active boolean function.
741
*/
743
return;
744
}
745
746
+ // Instantiate Akismet for BuddyPress
747
$bp->activity->akismet = new BP_Akismet();
748
}
749
750
/**
751
* AJAX endpoint for Suggestions API lookups.
752
*
753
+ * @since BuddyPress (2.1.0)
754
*/
755
function bp_ajax_get_suggestions() {
756
if ( ! bp_is_user_active() || empty( $_GET['term'] ) || empty( $_GET['type'] ) ) {
782
/**
783
* Detect a change in post type status, and initiate an activity update if necessary.
784
*
785
+ * @since BuddyPress (2.2.0)
786
*
787
* @todo Support untrashing better.
788
*
816
* This is a variable filter that is dependent on the post type
817
* being untrashed.
818
*
819
+ * @since BuddyPress (2.2.0)
820
*
821
* @param WP_Post $post Post data.
822
*/
828
829
// Unpublishing a previously published post.
830
} elseif ( 'publish' === $old_status ) {
831
+ // Some form of pending status - only remove the activity entry
832
bp_activity_post_type_unpublish( $post->ID, $post );
833
}
834
}
bp-activity/bp-activity-admin.php CHANGED
@@ -6,28 +6,28 @@
6
* help text, on which this implementation is heavily based.
7
*
8
* @package BuddyPress
9
- * @subpackage ActivityAdmin
10
- * @since 1.6.0
11
*/
12
13
- // Exit if accessed directly.
14
defined( 'ABSPATH' ) || exit;
15
16
- // Include WP's list table class.
17
if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
18
19
- // Per_page screen option. Has to be hooked in extremely early.
20
if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' == $_REQUEST['page'] )
21
add_filter( 'set-screen-option', 'bp_activity_admin_screen_options', 10, 3 );
22
23
/**
24
* Register the Activity component admin screen.
25
*
26
- * @since 1.6.0
27
*/
28
function bp_activity_add_admin_menu() {
29
30
- // Add our screen.
31
$hook = add_menu_page(
32
_x( 'Activity', 'Admin Dashbord SWA page title', 'buddypress' ),
33
_x( 'Activity', 'Admin Dashbord SWA menu', 'buddypress' ),
@@ -49,9 +49,10 @@ add_action( bp_core_admin_hook(), 'bp_activity_add_admin_menu' );
49
* which all appear together in the middle of the Dashboard menu. This function
50
* adds the Activity page to the array of these menu items.
51
*
52
- * @since 1.7.0
53
*
54
* @param array $custom_menus The list of top-level BP menu items.
55
* @return array $custom_menus List of top-level BP menu items, with Activity added.
56
*/
57
function bp_activity_admin_menu_order( $custom_menus = array() ) {
@@ -66,10 +67,10 @@ add_filter( 'bp_admin_menu_order', 'bp_activity_admin_menu_order' );
66
* Processes requests to add new activity comments, and echoes HTML for a new
67
* table row.
68
*
69
- * @since 1.6.0
70
*/
71
function bp_activity_admin_reply() {
72
- // Check nonce.
73
check_ajax_referer( 'bp-activity-admin-reply', '_ajax_nonce-bp-activity-admin-reply' );
74
75
$parent_id = ! empty( $_REQUEST['parent_id'] ) ? (int) $_REQUEST['parent_id'] : 0;
@@ -79,15 +80,15 @@ function bp_activity_admin_reply() {
79
if ( empty( $parent_id ) )
80
die( '-1' );
81
82
- // If $root_id not set (e.g. for root items), use $parent_id.
83
if ( empty( $root_id ) )
84
$root_id = $parent_id;
85
86
- // Check that a reply has been entered.
87
if ( empty( $_REQUEST['content'] ) )
88
die( __( 'ERROR: Please type a reply.', 'buddypress' ) );
89
90
- // Check parent activity exists.
91
$parent_activity = new BP_Activity_Activity( $parent_id );
92
if ( empty( $parent_activity->component ) )
93
die( __( 'ERROR: The item you are trying to reply to cannot be found, or it has been deleted.', 'buddypress' ) );
@@ -97,25 +98,25 @@ function bp_activity_admin_reply() {
97
if ( ! current_user_can( 'bp_moderate' ) )
98
die( '-1' );
99
100
- // Add new activity comment.
101
$new_activity_id = bp_activity_new_comment( array(
102
- 'activity_id' => $root_id, // ID of the root activity item.
103
'content' => $_REQUEST['content'],
104
- 'parent_id' => $parent_id, // ID of a parent comment.
105
) );
106
107
- // Fetch the new activity item, as we need it to create table markup to return.
108
$new_activity = new BP_Activity_Activity( $new_activity_id );
109
110
- // This needs to be set for the BP_Activity_List_Table constructor to work.
111
set_current_screen( 'toplevel_page_bp-activity' );
112
113
- // Set up an output buffer.
114
ob_start();
115
$list_table = new BP_Activity_List_Table();
116
$list_table->single_row( (array) $new_activity );
117
118
- // Get table markup.
119
$response = array(
120
'data' => ob_get_contents(),
121
'id' => $new_activity_id,
@@ -124,7 +125,7 @@ function bp_activity_admin_reply() {
124
);
125
ob_end_clean();
126
127
- // Send response.
128
$r = new WP_Ajax_Response();
129
$r->add( $response );
130
$r->send();
@@ -136,18 +137,19 @@ add_action( 'wp_ajax_bp-activity-admin-reply', 'bp_activity_admin_reply' );
136
/**
137
* Handle save/update of screen options for the Activity component admin screen.
138
*
139
- * @since 1.6.0
140
*
141
* @param string $value Will always be false unless another plugin filters it first.
142
* @param string $option Screen option name.
143
* @param string $new_value Screen option form value.
144
* @return string Option value. False to abandon update.
145
*/
146
function bp_activity_admin_screen_options( $value, $option, $new_value ) {
147
if ( 'toplevel_page_bp_activity_per_page' != $option && 'toplevel_page_bp_activity_network_per_page' != $option )
148
return $value;
149
150
- // Per page.
151
$new_value = (int) $new_value;
152
if ( $new_value < 1 || $new_value > 999 )
153
return $value;
@@ -158,23 +160,24 @@ function bp_activity_admin_screen_options( $value, $option, $new_value ) {
158
/**
159
* Hide the advanced edit meta boxes by default, so we don't clutter the screen.
160
*
161
- * @since 1.6.0
162
*
163
* @param array $hidden Array of items to hide.
164
* @param WP_Screen $screen Screen identifier.
165
* @return array Hidden Meta Boxes.
166
*/
167
function bp_activity_admin_edit_hidden_metaboxes( $hidden, $screen ) {
168
if ( empty( $screen->id ) || 'toplevel_page_bp-activity' != $screen->id && 'toplevel_page_bp-activity_network' != $screen->id )
169
return $hidden;
170
171
- // Hide the primary link meta box by default.
172
$hidden = array_merge( (array) $hidden, array( 'bp_activity_itemids', 'bp_activity_link', 'bp_activity_type', 'bp_activity_userid', ) );
173
174
/**
175
* Filters default hidden metaboxes so plugins can alter list.
176
*
177
- * @since 1.6.0
178
*
179
* @param array $hidden Default metaboxes to hide.
180
* @param WP_Screen $screen Screen identifier.
@@ -191,7 +194,7 @@ add_filter( 'default_hidden_meta_boxes', 'bp_activity_admin_edit_hidden_metaboxe
191
* - Enqueues scripts and styles.
192
* - Catches POST and GET requests related to Activity.
193
*
194
- * @since 1.6.0
195
*
196
* @global object $bp BuddyPress global settings.
197
* @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table.
@@ -201,7 +204,7 @@ function bp_activity_admin_load() {
201
202
$bp = buddypress();
203
204
- // Decide whether to load the dev version of the CSS and JavaScript.
205
$min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : 'min.';
206
207
$doaction = bp_admin_list_table_current_bulk_action();
@@ -209,15 +212,15 @@ function bp_activity_admin_load() {
209
/**
210
* Fires at top of Activity admin page.
211
*
212
- * @since 1.6.0
213
*
214
* @param string $doaction Current $_GET action being performed in admin screen.
215
*/
216
do_action( 'bp_activity_admin_load', $doaction );
217
218
- // Edit screen.
219
if ( 'edit' == $doaction && ! empty( $_GET['aid'] ) ) {
220
- // Columns screen option.
221
add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) );
222
223
get_current_screen()->add_help_tab( array(
@@ -239,7 +242,7 @@ function bp_activity_admin_load() {
239
'<p>' . __( 'For information about when and how BuddyPress uses all of these settings, see the Managing Activity link in the panel to the side.', 'buddypress' ) . '</p>'
240
) );
241
242
- // Help panel - sidebar links.
243
get_current_screen()->set_help_sidebar(
244
'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
245
'<p>' . __( '<a href="https://codex.buddypress.org/administrator-guide/activity-stream-management-panels/">Managing Activity</a>', 'buddypress' ) . '</p>' .
@@ -253,27 +256,20 @@ function bp_activity_admin_load() {
253
add_meta_box( 'bp_activity_type', _x( 'Type', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_type', get_current_screen()->id, 'normal', 'core' );
254
add_meta_box( 'bp_activity_userid', _x( 'Author ID', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_userid', get_current_screen()->id, 'normal', 'core' );
255
256
- /**
257
- * Fires after the registration of all of the default activity meta boxes.
258
- *
259
- * @since 2.4.0
260
- */
261
- do_action( 'bp_activity_admin_meta_boxes' );
262
-
263
- // Enqueue JavaScript files.
264
wp_enqueue_script( 'postbox' );
265
wp_enqueue_script( 'dashboard' );
266
wp_enqueue_script( 'comment' );
267
268
- // Index screen.
269
} else {
270
- // Create the Activity screen list table.
271
$bp_activity_list_table = new BP_Activity_List_Table();
272
273
- // The per_page screen option.
274
add_screen_option( 'per_page', array( 'label' => _x( 'Activity', 'Activity items per page (screen options)', 'buddypress' )) );
275
276
- // Help panel - overview text.
277
get_current_screen()->add_help_tab( array(
278
'id' => 'bp-activity-overview',
279
'title' => __( 'Overview', 'buddypress' ),
@@ -282,7 +278,7 @@ function bp_activity_admin_load() {
282
'<p>' . __( 'There are many different types of activities. Some are generated automatically by BuddyPress and other plugins, and some are entered directly by a user in the form of status update. To help manage the different activity types, use the filter dropdown box to switch between them.', 'buddypress' ) . '</p>'
283
) );
284
285
- // Help panel - moderation text.
286
get_current_screen()->add_help_tab( array(
287
'id' => 'bp-activity-moderating',
288
'title' => __( 'Moderating Activity', 'buddypress' ),
@@ -291,14 +287,14 @@ function bp_activity_admin_load() {
291
'<p>' . __( "In the <strong>In Response To</strong> column, if the activity was in reply to another activity, it shows that activity's author's picture and name, and a link to that activity on your live site. If there is a small bubble, the number in it shows how many other activities are related to this one; these are usually comments. Clicking the bubble will filter the activity screen to show only related activity items.", 'buddypress' ) . '</p>'
292
) );
293
294
- // Help panel - sidebar links.
295
get_current_screen()->set_help_sidebar(
296
'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
297
'<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
298
);
299
}
300
301
- // Enqueue CSS and JavaScript.
302
wp_enqueue_script( 'bp_activity_admin_js', $bp->plugin_url . "bp-activity/admin/js/admin.{$min}js", array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true );
303
wp_localize_script( 'bp_activity_admin_js', 'bp_activity_admin_vars', array(
304
'page' => get_current_screen()->id
@@ -310,27 +306,21 @@ function bp_activity_admin_load() {
310
wp_style_add_data( 'bp_activity_admin_css', 'suffix', $min );
311
}
312
313
- /**
314
- * Fires after the activity js and style has been enqueued.
315
- *
316
- * @since 2.4.0
317
- */
318
- do_action( 'bp_activity_admin_enqueue_scripts' );
319
320
- // Handle spam/un-spam/delete of activities.
321
if ( !empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', ) ) ) {
322
323
- // Build redirection URL.
324
$redirect_to = remove_query_arg( array( 'aid', 'deleted', 'error', 'spammed', 'unspammed', ), wp_get_referer() );
325
$redirect_to = add_query_arg( 'paged', $bp_activity_list_table->get_pagenum(), $redirect_to );
326
327
- // Get activity IDs.
328
$activity_ids = array_map( 'absint', (array) $_REQUEST['aid'] );
329
330
/**
331
* Filters list of IDs being spammed/un-spammed/deleted.
332
*
333
- * @since 1.6.0
334
*
335
* @param array $activity_ids Activity IDs to spam/un-spam/delete.
336
*/
@@ -338,32 +328,32 @@ function bp_activity_admin_load() {
338
339
// Is this a bulk request?
340
if ( 'bulk_' == substr( $doaction, 0, 5 ) && ! empty( $_REQUEST['aid'] ) ) {
341
- // Check this is a valid form submission.
342
check_admin_referer( 'bulk-activities' );
343
344
- // Trim 'bulk_' off the action name to avoid duplicating a ton of code.
345
$doaction = substr( $doaction, 5 );
346
347
// This is a request to delete, spam, or un-spam, a single item.
348
} elseif ( !empty( $_REQUEST['aid'] ) ) {
349
350
- // Check this is a valid form submission.
351
check_admin_referer( 'spam-activity_' . $activity_ids[0] );
352
}
353
354
- // Initialise counters for how many of each type of item we perform an action on.
355
$deleted = $spammed = $unspammed = 0;
356
357
- // Store any errors that occurs when updating the database items.
358
$errors = array();
359
360
// "We'd like to shoot the monster, could you move, please?"
361
foreach ( $activity_ids as $activity_id ) {
362
// @todo: Check the permissions on each
363
//if ( ! current_user_can( 'bp_edit_activity', $activity_id ) )
364
- // continue;
365
366
- // Get the activity from the database.
367
$activity = new BP_Activity_Activity( $activity_id );
368
if ( empty( $activity->component ) ) {
369
$errors[] = $activity_id;
@@ -391,7 +381,7 @@ function bp_activity_admin_load() {
391
bp_activity_mark_as_ham( $activity );
392
$result = $activity->save();
393
394
- // Check for any error during activity save.
395
if ( ! $result )
396
$errors[] = $activity->id;
397
else
@@ -402,7 +392,7 @@ function bp_activity_admin_load() {
402
bp_activity_mark_as_spam( $activity );
403
$result = $activity->save();
404
405
- // Check for any error during activity save.
406
if ( ! $result )
407
$errors[] = $activity->id;
408
else
@@ -413,7 +403,7 @@ function bp_activity_admin_load() {
413
break;
414
}
415
416
- // Release memory.
417
unset( $activity );
418
}
419
@@ -422,7 +412,7 @@ function bp_activity_admin_load() {
422
*
423
* Passes an activity array counts how many were spam, not spam, deleted, and IDs that were errors.
424
*
425
- * @since 1.6.0
426
*
427
* @param array $value Array holding spam, not spam, deleted counts, error IDs.
428
* @param string $redirect_to URL to redirect to.
@@ -440,14 +430,14 @@ function bp_activity_admin_load() {
440
if ( $deleted )
441
$redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );
442
443
- // If an error occurred, pass back the activity ID that failed.
444
if ( ! empty( $errors ) )
445
$redirect_to = add_query_arg( 'error', implode ( ',', array_map( 'absint', $errors ) ), $redirect_to );
446
447
/**
448
* Filters redirect URL after activity spamming/un-spamming/deletion occurs.
449
*
450
- * @since 1.6.0
451
*
452
* @param string $redirect_to URL to redirect to.
453
*/
@@ -455,72 +445,73 @@ function bp_activity_admin_load() {
455
exit;
456
457
458
- // Save the edit.
459
} elseif ( $doaction && 'save' == $doaction ) {
460
- // Build redirection URL.
461
$redirect_to = remove_query_arg( array( 'action', 'aid', 'deleted', 'error', 'spammed', 'unspammed', ), $_SERVER['REQUEST_URI'] );
462
463
- // Get activity ID.
464
$activity_id = (int) $_REQUEST['aid'];
465
466
- // Check this is a valid form submission.
467
check_admin_referer( 'edit-activity_' . $activity_id );
468
469
- // Get the activity from the database.
470
$activity = new BP_Activity_Activity( $activity_id );
471
472
- // If the activity doesn't exist, just redirect back to the index.
473
if ( empty( $activity->component ) ) {
474
wp_redirect( $redirect_to );
475
exit;
476
}
477
478
- // Check the form for the updated properties.
479
- // Store any error that occurs when updating the database item.
480
$error = 0;
481
482
- // Activity spam status.
483
$prev_spam_status = $new_spam_status = false;
484
if ( ! empty( $_POST['activity_status'] ) ) {
485
$prev_spam_status = $activity->is_spam;
486
$new_spam_status = ( 'spam' == $_POST['activity_status'] ) ? true : false;
487
}
488
489
- // Activity action.
490
if ( isset( $_POST['bp-activities-action'] ) )
491
$activity->action = $_POST['bp-activities-action'];
492
493
- // Activity content.
494
if ( isset( $_POST['bp-activities-content'] ) )
495
$activity->content = $_POST['bp-activities-content'];
496
497
- // Activity primary link.
498
if ( ! empty( $_POST['bp-activities-link'] ) )
499
$activity->primary_link = $_POST['bp-activities-link'];
500
501
- // Activity user ID.
502
if ( ! empty( $_POST['bp-activities-userid'] ) )
503
$activity->user_id = (int) $_POST['bp-activities-userid'];
504
505
- // Activity item primary ID.
506
if ( isset( $_POST['bp-activities-primaryid'] ) )
507
$activity->item_id = (int) $_POST['bp-activities-primaryid'];
508
509
- // Activity item secondary ID.
510
if ( isset( $_POST['bp-activities-secondaryid'] ) )
511
$activity->secondary_item_id = (int) $_POST['bp-activities-secondaryid'];
512
513
- // Activity type.
514
if ( ! empty( $_POST['bp-activities-type'] ) ) {
515
$actions = bp_activity_admin_get_activity_actions();
516
517
- // Check that the new type is a registered activity type.
518
if ( in_array( $_POST['bp-activities-type'], $actions ) ) {
519
$activity->type = $_POST['bp-activities-type'];
520
}
521
}
522
523
- // Activity timestamp.
524
if ( ! empty( $_POST['aa'] ) && ! empty( $_POST['mm'] ) && ! empty( $_POST['jj'] ) && ! empty( $_POST['hh'] ) && ! empty( $_POST['mn'] ) && ! empty( $_POST['ss'] ) ) {
525
$aa = $_POST['aa'];
526
$mm = $_POST['mm'];
@@ -536,7 +527,7 @@ function bp_activity_admin_load() {
536
$mn = ( $mn > 59 ) ? $mn -60 : $mn;
537
$ss = ( $ss > 59 ) ? $ss -60 : $ss;
538
539
- // Reconstruct the date into a timestamp.
540
$gmt_date = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss );
541
542
$activity->date_recorded = $gmt_date;
@@ -550,26 +541,26 @@ function bp_activity_admin_load() {
550
bp_activity_mark_as_ham( $activity );
551
}
552
553
- // Save.
554
$result = $activity->save();
555
556
- // Clear the activity stream first page cache, in case this activity's timestamp was changed.
557
wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
558
559
- // Check for any error during activity save.
560
if ( false === $result )
561
$error = $activity->id;
562
563
/**
564
* Fires before redirect so plugins can do something first on save action.
565
*
566
- * @since 1.6.0
567
*
568
* @param array Array holding activity object and ID that holds error.
569
*/
570
do_action_ref_array( 'bp_activity_admin_edit_after', array( &$activity, $error ) );
571
572
- // If an error occurred, pass back the activity ID that failed.
573
if ( $error )
574
$redirect_to = add_query_arg( 'error', (int) $error, $redirect_to );
575
else
@@ -578,7 +569,7 @@ function bp_activity_admin_load() {
578
/**
579
* Filters URL to redirect to after saving.
580
*
581
- * @since 1.6.0
582
*
583
* @param string $redirect_to URL to redirect to.
584
*/
@@ -596,17 +587,17 @@ function bp_activity_admin_load() {
596
/**
597
* Output the Activity component admin screens.
598
*
599
- * @since 1.6.0
600
*/
601
function bp_activity_admin() {
602
- // Decide whether to load the index or edit screen.
603
$doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
604
605
- // Display the single activity edit screen.
606
if ( 'edit' == $doaction && ! empty( $_GET['aid'] ) )
607
bp_activity_admin_edit();
608
609
- // Otherwise, display the Activity index screen.
610
else
611
bp_activity_admin_index();
612
}
@@ -614,7 +605,7 @@ function bp_activity_admin() {
614
/**
615
* Display the single activity edit screen.
616
*
617
- * @since 1.6.0
618
*/
619
function bp_activity_admin_edit() {
620
@@ -623,7 +614,7 @@ function bp_activity_admin_edit() {
623
if ( ! is_super_admin() )
624
die( '-1' );
625
626
- // Get the activity from the database.
627
$activity = bp_activity_get( array(
628
'in' => ! empty( $_REQUEST['aid'] ) ? (int) $_REQUEST['aid'] : 0,
629
'max' => 1,
@@ -635,27 +626,28 @@ function bp_activity_admin_edit() {
635
if ( ! empty( $activity['activities'][0] ) ) {
636
$activity = $activity['activities'][0];
637
638
- // Workaround to use WP's touch_time() without duplicating that function.
639
$GLOBALS['comment'] = new stdClass;
640
$GLOBALS['comment']->comment_date = $activity->date_recorded;
641
} else {
642
$activity = '';
643
}
644
645
- // Construct URL for form.
646
$form_url = remove_query_arg( array( 'action', 'deleted', 'error', 'spammed', 'unspammed', ), $_SERVER['REQUEST_URI'] );
647
$form_url = add_query_arg( 'action', 'save', $form_url );
648
649
/**
650
* Fires before activity edit form is displays so plugins can modify the activity.
651
*
652
- * @since 1.6.0
653
*
654
* @param array $value Array holding single activity object that was passed by reference.
655
*/
656
do_action_ref_array( 'bp_activity_admin_edit', array( &$activity ) ); ?>
657
658
<div class="wrap">
659
<h2><?php printf( __( 'Editing Activity (ID #%s)', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?></h2>
660
661
<?php if ( ! empty( $activity ) ) : ?>
@@ -699,10 +691,7 @@ function bp_activity_admin_edit() {
699
</form>
700
701
<?php else : ?>
702
- <p>
703
- <?php _e( 'No activity found with this ID.', 'buddypress' ); ?>
704
- <a href="<?php echo esc_url( bp_get_admin_url( 'admin.php?page=bp-activity' ) ); ?>"><?php _e( 'Go back and try again.', 'buddypress' ); ?></a>
705
- </p>
706
<?php endif; ?>
707
708
</div><!-- .wrap -->
@@ -713,7 +702,7 @@ function bp_activity_admin_edit() {
713
/**
714
* Status metabox for the Activity admin edit screen.
715
*
716
- * @since 1.6.0
717
*
718
* @param object $item Activity item.
719
*/
@@ -733,17 +722,17 @@ function bp_activity_admin_edit_metabox_status( $item ) {
733
734
<div id="misc-publishing-actions">
735
<div class="misc-pub-section" id="comment-status-radio">
736
- <label class="approved" for="activity-status-approved"><input type="radio" name="activity_status" id="activity-status-approved" value="ham" <?php checked( $item->is_spam, 0 ); ?>><?php _e( 'Approved', 'buddypress' ); ?></label><br />
737
- <label class="spam" for="activity-status-spam"><input type="radio" name="activity_status" id="activity-status-spam" value="spam" <?php checked( $item->is_spam, 1 ); ?>><?php _e( 'Spam', 'buddypress' ); ?></label>
738
</div>
739
740
<div class="misc-pub-section curtime misc-pub-section-last">
741
<?php
742
- // Translators: Publish box date format, see http://php.net/date.
743
$datef = __( 'M j, Y @ G:i', 'buddypress' );
744
$date = date_i18n( $datef, strtotime( $item->date_recorded ) );
745
?>
746
- <span id="timestamp"><?php printf( __( 'Submitted on: %s', 'buddypress' ), '<strong>' . $date . '</strong>' ); ?></span>&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e( 'Edit', 'buddypress' ); ?></a>
747
748
<div id='timestampdiv' class='hide-if-js'>
749
<?php touch_time( 1, 0, 5 ); ?>
@@ -756,7 +745,7 @@ function bp_activity_admin_edit_metabox_status( $item ) {
756
757
<div id="major-publishing-actions">
758
<div id="publishing-action">
759
- <?php submit_button( __( 'Update', 'buddypress' ), 'primary', 'save', false ); ?>
760
</div>
761
<div class="clear"></div>
762
</div><!-- #major-publishing-actions -->
@@ -769,7 +758,7 @@ function bp_activity_admin_edit_metabox_status( $item ) {
769
/**
770
* Primary link metabox for the Activity admin edit screen.
771
*
772
- * @since 1.6.0
773
*
774
* @param object $item Activity item.
775
*/
@@ -777,8 +766,8 @@ function bp_activity_admin_edit_metabox_link( $item ) {
777
?>
778
779
<label class="screen-reader-text" for="bp-activities-link"><?php _e( 'Link', 'buddypress' ); ?></label>
780
- <input type="url" name="bp-activities-link" id="bp-activities-link" value="<?php echo esc_url( $item->primary_link ); ?>" aria-describedby="bp-activities-link-description" />
781
- <p id="bp-activities-link-description"><?php _e( 'Activity generated by posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item.', 'buddypress' ); ?></p>
782
783
<?php
784
}
@@ -786,7 +775,7 @@ function bp_activity_admin_edit_metabox_link( $item ) {
786
/**
787
* User ID metabox for the Activity admin edit screen.
788
*
789
- * @since 1.6.0
790
*
791
* @param object $item Activity item.
792
*/
@@ -794,7 +783,7 @@ function bp_activity_admin_edit_metabox_userid( $item ) {
794
?>
795
796
<label class="screen-reader-text" for="bp-activities-userid"><?php _e( 'Author ID', 'buddypress' ); ?></label>
797
- <input type="number" name="bp-activities-userid" id="bp-activities-userid" value="<?php echo esc_attr( $item->user_id ); ?>" min="1" />
798
799
<?php
800
}
@@ -804,9 +793,9 @@ function bp_activity_admin_edit_metabox_userid( $item ) {
804
*
805
* Format is [activity_type] => Pretty name for activity type.
806
*
807
- * @since 2.0.0
808
*
809
- * @return array $actions
810
*/
811
function bp_activity_admin_get_activity_actions() {
812
$actions = array();
@@ -820,10 +809,10 @@ function bp_activity_admin_get_activity_actions() {
820
}
821
}
822
823
- // This was a mis-named activity type from before BP 1.6.
824
unset( $actions['friends_register_activity_action'] );
825
826
- // Sort array by the human-readable value.
827
natsort( $actions );
828
829
return $actions;
@@ -832,7 +821,7 @@ function bp_activity_admin_get_activity_actions() {
832
/**
833
* Activity type metabox for the Activity admin edit screen.
834
*
835
- * @since 1.6.0
836
*
837
* @param object $item Activity item.
838
*/
@@ -850,17 +839,15 @@ function bp_activity_admin_edit_metabox_type( $item ) {
850
$actions[ $action[$i]['key'] ] = $action[$i]['value'];
851
}
852
853
- // This was a mis-named activity type from before BP 1.6.
854
unset( $actions['friends_register_activity_action'] );
855
856
- // Sort array by the human-readable value.
857
natsort( $actions );
858
859
- /*
860
- * If the activity type is not registered properly (eg, a plugin has
861
- * not called bp_activity_set_action()), add the raw type to the end
862
- * of the list.
863
- */
864
if ( ! isset( $actions[ $selected ] ) ) {
865
_doing_it_wrong( __FUNCTION__, sprintf( __( 'This activity item has a type (%s) that is not registered using bp_activity_set_action(), so no label is available.', 'buddypress' ), $selected ), '2.0.0' );
866
$actions[ $selected ] = $selected;
@@ -868,8 +855,7 @@ function bp_activity_admin_edit_metabox_type( $item ) {
868
869
?>
870
871
- <label for="bp-activities-type" class="screen-reader-text"><?php esc_html_e( 'Select activity type', 'buddypress' ); ?></label>
872
- <select name="bp-activities-type" id="bp-activities-type">
873
<?php foreach ( $actions as $k => $v ) : ?>
874
<option value="<?php echo esc_attr( $k ); ?>" <?php selected( $k, $selected ); ?>><?php echo esc_html( $v ); ?></option>
875
<?php endforeach; ?>
@@ -881,7 +867,7 @@ function bp_activity_admin_edit_metabox_type( $item ) {
881
/**
882
* Primary item ID/Secondary item ID metabox for the Activity admin edit screen.
883
*
884
- * @since 1.6.0
885
*
886
* @param object $item Activity item.
887
*/
@@ -903,7 +889,7 @@ function bp_activity_admin_edit_metabox_itemids( $item ) {
903
/**
904
* Display the Activity admin index screen, which contains a list of all the activities.
905
*
906
- * @since 1.6.0
907
*
908
* @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table.
909
* @global string $plugin_page The current plugin page.
@@ -913,7 +899,7 @@ function bp_activity_admin_index() {
913
914
$messages = array();
915
916
- // If the user has just made a change to an activity item, build status messages.
917
if ( ! empty( $_REQUEST['deleted'] ) || ! empty( $_REQUEST['spammed'] ) || ! empty( $_REQUEST['unspammed'] ) || ! empty( $_REQUEST['error'] ) || ! empty( $_REQUEST['updated'] ) ) {
918
$deleted = ! empty( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0;
919
$errors = ! empty( $_REQUEST['error'] ) ? $_REQUEST['error'] : '';
@@ -923,14 +909,14 @@ function bp_activity_admin_index() {
923
924
$errors = array_map( 'absint', explode( ',', $errors ) );
925
926
- // Make sure we don't get any empty values in $errors.
927
for ( $i = 0, $errors_count = count( $errors ); $i < $errors_count; $i++ ) {
928
if ( 0 === $errors[$i] ) {
929
unset( $errors[$i] );
930
}
931
}
932
933
- // Reindex array.
934
$errors = array_values( $errors );
935
936
if ( $deleted > 0 )
@@ -944,9 +930,9 @@ function bp_activity_admin_index() {
944
$error_msg = __( 'Errors occurred when trying to update these activity items:', 'buddypress' );
945
$error_msg .= '<ul class="activity-errors">';
946
947
- // Display each error as a list item.
948
foreach ( $errors as $error ) {
949
- // Translators: This is a bulleted list of item IDs.
950
$error_msg .= '<li>' . sprintf( __( '#%s', 'buddypress' ), number_format_i18n( $error ) ) . '</li>';
951
}
952
@@ -965,19 +951,20 @@ function bp_activity_admin_index() {
965
$messages[] = __( 'The activity item has been updated successfully.', 'buddypress' );
966
}
967
968
- // Prepare the activity items for display.
969
$bp_activity_list_table->prepare_items();
970
971
/**
972
* Fires before edit form is displayed so plugins can modify the activity messages.
973
*
974
- * @since 1.6.0
975
*
976
* @param array $messages Array of messages to display at top of page.
977
*/
978
do_action( 'bp_activity_admin_index', $messages ); ?>
979
980
<div class="wrap">
981
<h2>
982
<?php if ( !empty( $_REQUEST['aid'] ) ) : ?>
983
<?php printf( __( 'Activity related to ID #%s', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?>
@@ -990,12 +977,12 @@ function bp_activity_admin_index() {
990
<?php endif; ?>
991
</h2>
992
993
- <?php // If the user has just made a change to an activity item, display the status messages. ?>
994
<?php if ( !empty( $messages ) ) : ?>
995
<div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div>
996
<?php endif; ?>
997
998
- <?php // Display each activity on its own row. ?>
999
<?php $bp_activity_list_table->views(); ?>
1000
1001
<form id="bp-activities-form" action="" method="get">
@@ -1004,7 +991,7 @@ function bp_activity_admin_index() {
1004
<?php $bp_activity_list_table->display(); ?>
1005
</form>
1006
1007
- <?php // This markup is used for the reply form. ?>
1008
<table style="display: none;">
1009
<tr id="bp-activities-container" style="display: none;">
1010
<td colspan="4">
@@ -1036,54 +1023,55 @@ function bp_activity_admin_index() {
1036
/**
1037
* List table class for the Activity component admin page.
1038
*
1039
- * @since 1.6.0
1040
*/
1041
class BP_Activity_List_Table extends WP_List_Table {
1042
1043
/**
1044
* What type of view is being displayed?
1045
*
1046
- * E.g. "all", "pending", "approved", "spam"...
1047
*
1048
- * @since 1.6.0
1049
- * @var string $view
1050
*/
1051
public $view = 'all';
1052
1053
/**
1054
* How many activity items have been marked as spam.
1055
*
1056
- * @since 1.6.0
1057
- * @var int $spam_count
1058
*/
1059
public $spam_count = 0;
1060
1061
/**
1062
* Store activity-to-user-ID mappings for use in the In Response To column.
1063
*
1064
- * @since 1.6.0
1065
- * @var array $activity_user_id
1066
*/
1067
protected $activity_user_id = array();
1068
1069
/**
1070
* If users can comment on blog & forum activity items.
1071
*
1072
* @link https://buddypress.trac.wordpress.org/ticket/6277
1073
*
1074
- * @since 2.2.2
1075
- * @var bool $disable_blogforum_comments
1076
*/
1077
public $disable_blogforum_comments = false;
1078
1079
/**
1080
* Constructor.
1081
*
1082
- * @since 1.6.0
1083
*/
1084
public function __construct() {
1085
1086
- // See if activity commenting is enabled for blog / forum activity items.
1087
$this->disable_blogforum_comments = bp_disable_blogforum_comments();
1088
1089
// Define singular and plural labels, as well as whether we support AJAX.
@@ -1098,38 +1086,38 @@ class BP_Activity_List_Table extends WP_List_Table {
1098
/**
1099
* Handle filtering of data, sorting, pagination, and any other data manipulation prior to rendering.
1100
*
1101
- * @since 1.6.0
1102
*/
1103
function prepare_items() {
1104
1105
- // Option defaults.
1106
$filter = array();
1107
$include_id = false;
1108
$search_terms = false;
1109
$sort = 'DESC';
1110
$spam = 'ham_only';
1111
1112
- // Set current page.
1113
$page = $this->get_pagenum();
1114
1115
- // Set per page from the screen options.
1116
$per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) );
1117
1118
- // Check if we're on the "Spam" view.
1119
if ( !empty( $_REQUEST['activity_status'] ) && 'spam' == $_REQUEST['activity_status'] ) {
1120
$spam = 'spam_only';
1121
$this->view = 'spam';
1122
}
1123
1124
- // Sort order.
1125
if ( !empty( $_REQUEST['order'] ) && 'desc' != $_REQUEST['order'] )
1126
$sort = 'ASC';
1127
1128
- // Order by.
1129
/*if ( !empty( $_REQUEST['orderby'] ) ) {
1130
}*/
1131
1132
- // Filter.
1133
if ( !empty( $_REQUEST['activity_type'] ) )
1134
$filter = array( 'action' => $_REQUEST['activity_type'] );
1135
@@ -1141,7 +1129,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1141
if ( !empty( $_REQUEST['aid'] ) )
1142
$include_id = (int) $_REQUEST['aid'];
1143
1144
- // Get the spam total (ignoring any search query or filter).
1145
$spams = bp_activity_get( array(
1146
'display_comments' => 'stream',
1147
'show_hidden' => true,
@@ -1151,7 +1139,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1151
$this->spam_count = $spams['total'];
1152
unset( $spams );
1153
1154
- // Get the activities from the database.
1155
$activities = bp_activity_get( array(
1156
'display_comments' => 'stream',
1157
'filter' => $filter,
@@ -1160,7 +1148,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1160
'per_page' => $per_page,
1161
'search_terms' => $search_terms,
1162
'show_hidden' => true,
1163
- // 'sort' => $sort,
1164
'spam' => $spam,
1165
'count_total' => 'count_query',
1166
) );
@@ -1170,23 +1158,23 @@ class BP_Activity_List_Table extends WP_List_Table {
1170
$activities['activities'] = BP_Activity_List_Table::flatten_activity_array( $activities['activities'] );
1171
$activities['total'] = count( $activities['activities'] );
1172
1173
- // Sort the array by the activity object's date_recorded value.
1174
usort( $activities['activities'], create_function( '$a, $b', 'return $a->date_recorded > $b->date_recorded;' ) );
1175
}
1176
1177
- // The bp_activity_get function returns an array of objects; cast these to arrays for WP_List_Table.
1178
$new_activities = array();
1179
foreach ( $activities['activities'] as $activity_item ) {
1180
$new_activities[] = (array) $activity_item;
1181
1182
- // Build an array of activity-to-user ID mappings for better efficiency in the In Response To column.
1183
$this->activity_user_id[$activity_item->id] = $activity_item->user_id;
1184
}
1185
1186
- // Set raw data to display.
1187
$this->items = $new_activities;
1188
1189
- // Store information needed for handling table pagination.
1190
$this->set_pagination_args( array(
1191
'per_page' => $per_page,
1192
'total_items' => $activities['total'],
@@ -1200,7 +1188,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1200
/**
1201
* Get an array of all the columns on the page.
1202
*
1203
- * @since 1.6.0
1204
*
1205
* @return array Column headers.
1206
*/
@@ -1209,27 +1197,15 @@ class BP_Activity_List_Table extends WP_List_Table {
1209
$this->get_columns(),
1210
array(),
1211
$this->get_sortable_columns(),
1212
- $this->get_default_primary_column_name(),
1213
);
1214
1215
return $this->_column_headers;
1216
}
1217
1218
- /**
1219
- * Get name of default primary column
1220
- *
1221
- * @since 2.3.3
1222
- *
1223
- * @return string
1224
- */
1225
- protected function get_default_primary_column_name() {
1226
- return 'author';
1227
- }
1228
-
1229
/**
1230
* Display a message on screen when no items are found (e.g. no search matches).
1231
*
1232
- * @since 1.6.0
1233
*/
1234
function no_items() {
1235
_e( 'No activities found.', 'buddypress' );
@@ -1238,12 +1214,12 @@ class BP_Activity_List_Table extends WP_List_Table {
1238
/**
1239
* Output the Activity data table.
1240
*
1241
- * @since 1.6.0
1242
- */
1243
function display() {
1244
$this->display_tablenav( 'top' ); ?>
1245
1246
- <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
1247
<thead>
1248
<tr>
1249
<?php $this->print_column_headers(); ?>
@@ -1268,7 +1244,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1268
/**
1269
* Generate content for a single row of the table.
1270
*
1271
- * @since 1.6.0
1272
*
1273
* @param object $item The current item.
1274
*/
@@ -1297,7 +1273,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1297
/**
1298
* Get the list of views available on this table (e.g. "all", "spam").
1299
*
1300
- * @since 1.6.0
1301
*/
1302
function get_views() {
1303
$url_base = add_query_arg( array( 'page' => 'bp-activity' ), bp_get_admin_url( 'admin.php' ) ); ?>
@@ -1311,7 +1287,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1311
/**
1312
* Fires inside listing of views so plugins can add their own.
1313
*
1314
- * @since 1.6.0
1315
*
1316
* @param string $url_base Current URL base for view.
1317
* @param string $view Current view being displayed.
@@ -1324,7 +1300,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1324
/**
1325
* Get bulk actions.
1326
*
1327
- * @since 1.6.0
1328
*
1329
* @return array Key/value pairs for the bulk actions dropdown.
1330
*/
@@ -1337,7 +1313,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1337
/**
1338
* Filters the default bulk actions so plugins can add custom actions.
1339
*
1340
- * @since 1.6.0
1341
*
1342
* @param array $actions Default available actions for bulk operations.
1343
*/
@@ -1347,27 +1323,20 @@ class BP_Activity_List_Table extends WP_List_Table {
1347
/**
1348
* Get the table column titles.
1349
*
1350
- * @since 1.6.0
1351
*
1352
* @see WP_List_Table::single_row_columns()
1353
*
1354
* @return array The columns to appear in the Activity list table.
1355
*/
1356
function get_columns() {
1357
- /**
1358
- * Filters the titles for the columns for the activity list table.
1359
- *
1360
- * @since 2.4.0
1361
- *
1362
- * @param array $value Array of slugs and titles for the columns.
1363
- */
1364
- return apply_filters( 'bp_activity_list_table_get_columns', array(
1365
'cb' => '<input name type="checkbox" />',
1366
'author' => _x('Author', 'Admin SWA column header', 'buddypress' ),
1367
'comment' => _x( 'Activity', 'Admin SWA column header', 'buddypress' ),
1368
'action' => _x( 'Action', 'Admin SWA column header', 'buddypress' ),
1369
'response' => _x( 'In Response To', 'Admin SWA column header', 'buddypress' ),
1370
- ) );
1371
}
1372
1373
/**
@@ -1375,7 +1344,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1375
*
1376
* Currently, returns an empty array (no columns are sortable).
1377
*
1378
- * @since 1.6.0
1379
* @todo For this to work, BP_Activity_Activity::get() needs updating
1380
* to support ordering by specific fields.
1381
*
@@ -1392,13 +1361,13 @@ class BP_Activity_List_Table extends WP_List_Table {
1392
/**
1393
* Markup for the "filter" part of the form (i.e. which activity type to display).
1394
*
1395
- * @since 1.6.0
1396
*
1397
* @param string $which 'top' or 'bottom'.
1398
*/
1399
function extra_tablenav( $which ) {
1400
1401
- // Bail on bottom table nav.
1402
if ( 'bottom' === $which ) {
1403
return;
1404
}
@@ -1406,12 +1375,11 @@ class BP_Activity_List_Table extends WP_List_Table {
1406
// Is any filter currently selected?
1407
$selected = ( ! empty( $_REQUEST['activity_type'] ) ) ? $_REQUEST['activity_type'] : '';
1408
1409
- // Get the actions.
1410
$activity_actions = bp_activity_get_actions(); ?>
1411
1412
<div class="alignleft actions">
1413
- <label for="activity-type" class="screen-reader-text"><?php _e( 'Filter by activity type', 'buddypress' ); ?></label>
1414
- <select name="activity_type" id="activity-type">
1415
<option value="" <?php selected( ! $selected ); ?>><?php _e( 'View all actions', 'buddypress' ); ?></option>
1416
1417
<?php foreach ( $activity_actions as $component => $actions ) : ?>
@@ -1422,7 +1390,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1422
1423
<?php
1424
1425
- // Skip the incorrectly named pre-1.6 action.
1426
if ( 'friends_register_activity_action' !== $action_key ) : ?>
1427
1428
<option value="<?php echo esc_attr( $action_key ); ?>" <?php selected( $action_key, $selected ); ?>><?php echo esc_html( $action_values[ 'value' ] ); ?></option>
@@ -1443,41 +1411,10 @@ class BP_Activity_List_Table extends WP_List_Table {
1443
<?php
1444
}
1445
1446
- /**
1447
- * Override WP_List_Table::row_actions().
1448
- *
1449
- * Basically a duplicate of the row_actions() method, but removes the
1450
- * unnecessary <button> addition.
1451
- *
1452
- * @since 2.3.3
1453
- * @since 2.3.4 Visibility set to public for compatibility with WP < 4.0.0.
1454
- *
1455
- * @param array $actions The list of actions.
1456
- * @p