BuddyPress - Version 2.6.3

Version Description

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

Download this release

Release Info

Developer DJPaul
Plugin Icon 128x128 BuddyPress
Version 2.6.3
Comparing to
See all releases

Code changes from version 2.4.4 to 2.6.3

Files changed (413) hide show
  1. bp-activity/admin/js/admin.min.js +0 -1
  2. bp-activity/bp-activity-actions.php +163 -106
  3. bp-activity/bp-activity-admin.php +62 -836
  4. bp-activity/bp-activity-adminbar.php +47 -0
  5. bp-activity/bp-activity-akismet.php +2 -639
  6. bp-activity/bp-activity-cache.php +4 -2
  7. bp-activity/bp-activity-classes.php +6 -0
  8. bp-activity/bp-activity-cssjs.php +2 -1
  9. bp-activity/bp-activity-embeds.php +352 -0
  10. bp-activity/bp-activity-filters.php +52 -40
  11. bp-activity/bp-activity-functions.php +718 -219
  12. bp-activity/bp-activity-loader.php +5 -373
  13. bp-activity/bp-activity-notifications.php +293 -305
  14. bp-activity/bp-activity-screens.php +27 -231
  15. bp-activity/bp-activity-template.php +43 -695
  16. bp-activity/classes/class-bp-activity-activity.php +140 -32
  17. bp-activity/classes/class-bp-activity-component.php +393 -0
  18. bp-activity/classes/class-bp-activity-feed.php +24 -3
  19. bp-activity/classes/class-bp-activity-list-table.php +844 -0
  20. bp-activity/classes/class-bp-activity-oembed-extension.php +329 -0
  21. bp-activity/classes/class-bp-activity-query.php +1 -0
  22. bp-activity/classes/class-bp-activity-template.php +409 -0
  23. bp-activity/classes/class-bp-activity-theme-compat.php +180 -0
  24. bp-activity/classes/class-bp-akismet.php +651 -0
  25. bp-activity/css/mentions-rtl.css +2 -3
  26. bp-activity/css/mentions-rtl.min.css +1 -1
  27. bp-activity/css/mentions.css +3 -3
  28. bp-activity/css/mentions.min.css +1 -1
  29. bp-activity/js/mentions.js +1 -1
  30. bp-activity/js/mentions.min.js +1 -2
  31. bp-blogs/bp-blogs-actions.php +5 -4
  32. bp-blogs/bp-blogs-activity.php +526 -206
  33. bp-blogs/bp-blogs-cache.php +6 -5
  34. bp-blogs/bp-blogs-classes.php +1 -0
  35. bp-blogs/bp-blogs-filters.php +6 -9
  36. bp-blogs/bp-blogs-functions.php +348 -502
  37. bp-blogs/bp-blogs-loader.php +4 -330
  38. bp-blogs/bp-blogs-screens.php +6 -192
  39. bp-blogs/bp-blogs-template.php +75 -296
  40. bp-blogs/bp-blogs-widgets.php +6 -146
  41. bp-blogs/classes/class-bp-blogs-blog.php +49 -43
  42. bp-blogs/classes/class-bp-blogs-component.php +316 -0
  43. bp-blogs/classes/class-bp-blogs-recent-posts-widget.php +164 -0
  44. bp-blogs/classes/class-bp-blogs-template.php +246 -0
  45. bp-blogs/classes/class-bp-blogs-theme-compat.php +201 -0
  46. bp-core/admin/bp-core-admin-actions.php +31 -31
  47. bp-core/admin/bp-core-admin-classes.php +13 -0
  48. bp-core/admin/bp-core-admin-components.php +71 -134
  49. bp-core/admin/bp-core-admin-functions.php +234 -98
  50. bp-core/admin/bp-core-admin-schema.php +59 -41
  51. bp-core/admin/bp-core-admin-settings.php +19 -33
  52. bp-core/admin/bp-core-admin-slugs.php +9 -7
  53. bp-core/admin/bp-core-admin-tools.php +120 -35
  54. bp-core/admin/css/common-rtl.css +353 -118
  55. bp-core/admin/css/common-rtl.min.css +1 -1
  56. bp-core/admin/css/common.css +353 -118
  57. bp-core/admin/css/common.min.css +1 -1
  58. bp-core/admin/css/customizer-controls-rtl.css +10 -0
  59. bp-core/admin/css/customizer-controls-rtl.min.css +1 -0
  60. bp-core/admin/css/customizer-controls.css +10 -0
  61. bp-core/admin/css/customizer-controls.min.css +1 -0
  62. bp-core/admin/images/accessibility.gif +0 -0
  63. bp-core/admin/images/activity-embeds.png +0 -0
  64. bp-core/admin/images/default-themes.png +0 -0
  65. bp-core/admin/images/group-cover-image.png +0 -0
  66. bp-core/admin/images/group-home-page.png +0 -0
  67. bp-core/admin/images/group-type-pop.png +0 -0
  68. bp-core/admin/images/member-type-field.png +0 -0
  69. bp-core/admin/images/new-nav-api.png +0 -0
  70. bp-core/admin/images/theme-stylesheets.png +0 -0
  71. bp-core/admin/images/user-frontpage.png +0 -0
  72. bp-core/admin/js/customizer-controls.js +22 -0
  73. bp-core/admin/js/customizer-controls.min.js +1 -0
  74. bp-core/admin/js/customizer-receiver-emails.js +115 -0
  75. bp-core/admin/js/customizer-receiver-emails.min.js +1 -0
  76. bp-core/bp-core-actions.php +11 -6
  77. bp-core/bp-core-admin.php +3 -879
  78. bp-core/bp-core-adminbar.php +13 -23
  79. bp-core/bp-core-attachments.php +248 -196
  80. bp-core/bp-core-avatars.php +229 -150
  81. bp-core/bp-core-buddybar.php +309 -225
  82. bp-core/bp-core-cache.php +25 -19
  83. bp-core/bp-core-caps.php +21 -40
  84. bp-core/bp-core-catchuri.php +165 -95
  85. bp-core/bp-core-classes.php +14 -0
  86. bp-core/bp-core-component.php +3 -812
  87. bp-core/bp-core-cssjs.php +32 -28
  88. bp-core/bp-core-customizer-email.php +443 -0
  89. bp-core/bp-core-dependency.php +134 -42
  90. bp-core/bp-core-filters.php +316 -245
  91. bp-core/bp-core-functions.php +1010 -222
  92. bp-core/bp-core-loader.php +4 -266
  93. bp-core/bp-core-moderation.php +76 -72
  94. bp-core/bp-core-options.php +61 -120
  95. bp-core/bp-core-taxonomy.php +75 -21
  96. bp-core/bp-core-template-loader.php +114 -70
  97. bp-core/bp-core-template.php +467 -228
  98. bp-core/bp-core-theme-compatibility.php +82 -224
  99. bp-core/bp-core-update.php +384 -376
  100. bp-core/bp-core-widgets.php +5 -168
  101. bp-core/bp-core-wpabstraction.php +99 -9
  102. bp-core/classes/class-bp-admin.php +1131 -0
  103. bp-core/classes/class-bp-attachment-avatar.php +38 -57
  104. bp-core/classes/class-bp-attachment-cover-image.php +51 -44
  105. bp-core/classes/class-bp-attachment.php +49 -65
  106. bp-core/classes/class-bp-button.php +18 -15
  107. bp-core/classes/class-bp-component.php +844 -0
  108. bp-core/classes/class-bp-core-bp-nav-backcompat.php +270 -0
  109. bp-core/classes/class-bp-core-bp-options-nav-backcompat.php +138 -0
  110. bp-core/classes/class-bp-core-login-widget.php +186 -0
  111. bp-core/classes/class-bp-core-nav-item.php +34 -0
  112. bp-core/classes/class-bp-core-nav.php +402 -0
  113. bp-core/classes/class-bp-core-notification.php +16 -18
  114. bp-core/classes/class-bp-core-oembed-extension.php +616 -0
  115. bp-core/classes/class-bp-core-sort-by-key-callback.php +83 -0
  116. bp-core/classes/class-bp-core-user.php +57 -76
  117. bp-core/classes/class-bp-core.php +326 -0
  118. bp-core/classes/class-bp-customizer-control-range.php +57 -0
  119. bp-core/classes/class-bp-date-query.php +4 -3
  120. bp-core/classes/class-bp-email-delivery.php +31 -0
  121. bp-core/classes/class-bp-email-recipient.php +195 -0
  122. bp-core/classes/class-bp-email.php +963 -0
  123. bp-core/classes/class-bp-embed.php +27 -26
  124. bp-core/classes/class-bp-media-extractor.php +12 -22
  125. bp-core/classes/class-bp-members-suggestions.php +2 -1
  126. bp-core/classes/class-bp-phpmailer.php +152 -0
  127. bp-core/classes/class-bp-recursive-query.php +1 -0
  128. bp-core/classes/class-bp-suggestions.php +5 -2
  129. bp-core/classes/class-bp-theme-compat.php +120 -0
  130. bp-core/classes/class-bp-user-query.php +58 -59
  131. bp-core/classes/class-bp-walker-category-checklist.php +109 -0
  132. bp-core/classes/class-bp-walker-nav-menu-checklist.php +2 -1
  133. bp-core/classes/class-bp-walker-nav-menu.php +10 -10
  134. bp-core/css/admin-bar-rtl.css +1 -1
  135. bp-core/css/admin-bar.css +1 -1
  136. bp-core/css/avatar-rtl.css +11 -2
  137. bp-core/css/avatar-rtl.min.css +1 -1
  138. bp-core/css/avatar.css +11 -2
  139. bp-core/css/avatar.min.css +1 -1
  140. bp-core/css/buddybar-rtl.css +3 -3
  141. bp-core/css/buddybar-rtl.min.css +1 -1
  142. bp-core/deprecated/1.2.php +0 -2
  143. bp-core/deprecated/1.5.php +0 -2
  144. bp-core/deprecated/1.6.php +1 -1
  145. bp-core/deprecated/1.7.php +0 -1
  146. bp-core/deprecated/2.1.php +4 -53
  147. bp-core/deprecated/2.5.php +934 -0
  148. bp-core/deprecated/2.6.php +50 -0
  149. bp-core/deprecated/js/autocomplete/jquery.autocomplete.min.js +0 -2
  150. bp-core/deprecated/js/autocomplete/jquery.autocompletefb.min.js +0 -2
  151. bp-core/images/mystery-group-50.png +0 -0
  152. bp-core/images/mystery-group.png +0 -0
  153. bp-core/js/avatar.js +22 -12
  154. bp-core/js/avatar.min.js +1 -2
  155. bp-core/js/bp-plupload.min.js +0 -1
  156. bp-core/js/confirm.min.js +0 -1
  157. bp-core/js/cover-image.min.js +0 -1
  158. bp-core/js/jquery-cookie.min.js +0 -1
  159. bp-core/js/jquery-query.min.js +0 -1
  160. bp-core/js/jquery-scroll-to.min.js +0 -1
  161. bp-core/js/jquery.atwho.min.js +0 -1
  162. bp-core/js/jquery.caret.min.js +0 -1
  163. bp-core/js/webcam.js +3 -1
  164. bp-core/js/webcam.min.js +1 -2
  165. bp-core/js/widget-members.js +12 -1
  166. bp-core/js/widget-members.min.js +1 -2
  167. bp-forums/bb-config.php +1 -0
  168. bp-forums/bp-forums-actions.php +1 -0
  169. bp-forums/bp-forums-bbpress-sa.php +36 -0
  170. bp-forums/bp-forums-bbpress.php +1 -0
  171. bp-forums/bp-forums-filters.php +13 -0
  172. bp-forums/bp-forums-functions.php +51 -0
  173. bp-forums/bp-forums-loader.php +12 -0
  174. bp-forums/bp-forums-screens.php +13 -0
  175. bp-forums/bp-forums-template.php +307 -9
  176. bp-forums/deprecated/1.6.php +12 -6
  177. bp-friends/bp-friends-actions.php +5 -0
  178. bp-friends/bp-friends-activity.php +27 -1
  179. bp-friends/bp-friends-cache.php +3 -0
  180. bp-friends/bp-friends-classes.php +1 -0
  181. bp-friends/bp-friends-filters.php +1 -0
  182. bp-friends/bp-friends-functions.php +49 -0
  183. bp-friends/bp-friends-loader.php +5 -247
  184. bp-friends/bp-friends-notifications.php +35 -147
  185. bp-friends/bp-friends-screens.php +23 -4
  186. bp-friends/bp-friends-template.php +63 -14
  187. bp-friends/bp-friends-widgets.php +5 -174
  188. bp-friends/classes/class-bp-core-friends-widget.php +208 -0
  189. bp-friends/classes/class-bp-friends-component.php +292 -0
  190. bp-friends/classes/class-bp-friends-friendship.php +80 -23
  191. bp-friends/js/widget-friends.js +12 -1
  192. bp-friends/js/widget-friends.min.js +1 -2
  193. bp-groups/admin/js/admin.min.js +0 -1
  194. bp-groups/bp-groups-actions.php +71 -43
  195. bp-groups/bp-groups-activity.php +26 -26
  196. bp-groups/bp-groups-admin.php +192 -714
  197. bp-groups/bp-groups-adminbar.php +18 -17
  198. bp-groups/bp-groups-cache.php +52 -5
  199. bp-groups/bp-groups-classes.php +1 -0
  200. bp-groups/bp-groups-filters.php +93 -23
  201. bp-groups/bp-groups-forums.php +8 -16
  202. bp-groups/bp-groups-functions.php +747 -139
  203. bp-groups/bp-groups-loader.php +3 -789
  204. bp-groups/bp-groups-notifications.php +94 -423
  205. bp-groups/bp-groups-screens.php +147 -320
  206. bp-groups/bp-groups-template.php +906 -1201
  207. bp-groups/bp-groups-widgets.php +17 -177
  208. bp-groups/classes/class-bp-group-extension.php +110 -102
  209. bp-groups/classes/class-bp-group-member-query.php +25 -24
  210. bp-groups/classes/class-bp-groups-component.php +867 -0
  211. bp-groups/classes/class-bp-groups-group-members-template.php +278 -0
  212. bp-groups/classes/class-bp-groups-group.php +254 -170
  213. bp-groups/classes/class-bp-groups-invite-template.php +270 -0
  214. bp-groups/classes/class-bp-groups-list-table.php +648 -0
  215. bp-groups/classes/class-bp-groups-member-suggestions.php +3 -2
  216. bp-groups/classes/class-bp-groups-member.php +146 -51
  217. bp-groups/classes/class-bp-groups-membership-requests-template.php +255 -0
  218. bp-groups/classes/class-bp-groups-template.php +403 -0
  219. bp-groups/classes/class-bp-groups-theme-compat.php +263 -0
  220. bp-groups/classes/class-bp-groups-widget.php +231 -0
  221. bp-groups/js/widget-groups.js +12 -1
  222. bp-groups/js/widget-groups.min.js +1 -2
  223. bp-loader.php +168 -42
  224. bp-members/admin/bp-members-admin-classes.php +5 -764
  225. bp-members/admin/css/admin-rtl.css +98 -8
  226. bp-members/admin/css/admin-rtl.min.css +1 -1
  227. bp-members/admin/css/admin.css +98 -8
  228. bp-members/admin/css/admin.min.css +1 -1
  229. bp-members/admin/js/admin.min.js +0 -1
  230. bp-members/bp-members-actions.php +5 -0
  231. bp-members/bp-members-activity.php +3 -2
  232. bp-members/bp-members-admin.php +3 -1968
  233. bp-members/bp-members-adminbar.php +3 -2
  234. bp-members/bp-members-cache.php +2 -3
  235. bp-members/bp-members-classes.php +1 -0
  236. bp-members/bp-members-filters.php +2 -1
  237. bp-members/bp-members-functions.php +144 -83
  238. bp-members/bp-members-loader.php +5 -300
  239. bp-members/bp-members-screens.php +17 -341
  240. bp-members/bp-members-template.php +410 -310
  241. bp-members/bp-members-widgets.php +8 -518
  242. bp-members/classes/class-bp-core-members-template.php +301 -0
  243. bp-members/classes/class-bp-core-members-widget.php +259 -0
  244. bp-members/classes/class-bp-core-recently-active-widget.php +175 -0
  245. bp-members/classes/class-bp-core-whos-online-widget.php +175 -0
  246. bp-members/classes/class-bp-members-admin.php +2036 -0
  247. bp-members/classes/class-bp-members-component.php +403 -0
  248. bp-members/classes/class-bp-members-list-table.php +411 -0
  249. bp-members/classes/class-bp-members-ms-list-table.php +413 -0
  250. bp-members/classes/class-bp-members-theme-compat.php +215 -0
  251. bp-members/classes/class-bp-registration-theme-compat.php +140 -0
  252. bp-members/classes/class-bp-signup.php +13 -4
  253. bp-messages/bp-messages-actions.php +1 -0
  254. bp-messages/bp-messages-cache.php +1 -0
  255. bp-messages/bp-messages-classes.php +1 -0
  256. bp-messages/bp-messages-cssjs.php +18 -5
  257. bp-messages/bp-messages-filters.php +8 -0
  258. bp-messages/bp-messages-functions.php +17 -7
  259. bp-messages/bp-messages-loader.php +3 -327
  260. bp-messages/bp-messages-notifications.php +94 -111
  261. bp-messages/bp-messages-screens.php +13 -3
  262. bp-messages/bp-messages-star.php +1 -2
  263. bp-messages/bp-messages-template.php +33 -526
  264. bp-messages/bp-messages-widgets.php +5 -110
  265. bp-messages/classes/class-bp-messages-box-template.php +347 -0
  266. bp-messages/classes/class-bp-messages-component.php +366 -0
  267. bp-messages/classes/class-bp-messages-message.php +2 -1
  268. bp-messages/classes/class-bp-messages-notice.php +2 -1
  269. bp-messages/classes/class-bp-messages-sitewide-notices-widget.php +122 -0
  270. bp-messages/classes/class-bp-messages-thread-template.php +186 -0
  271. bp-messages/classes/class-bp-messages-thread.php +1 -0
  272. {bp-core/deprecated → bp-messages}/css/autocomplete/jquery.autocompletefb-rtl.css +2 -2
  273. {bp-core/deprecated → bp-messages}/css/autocomplete/jquery.autocompletefb-rtl.min.css +1 -1
  274. {bp-core/deprecated → bp-messages}/css/autocomplete/jquery.autocompletefb.css +0 -0
  275. {bp-core/deprecated → bp-messages}/css/autocomplete/jquery.autocompletefb.min.css +0 -0
  276. {bp-core/deprecated → bp-messages}/js/autocomplete/jquery.autocomplete.js +2 -1
  277. bp-messages/js/autocomplete/jquery.autocomplete.min.js +1 -0
  278. {bp-core/deprecated → bp-messages}/js/autocomplete/jquery.autocompletefb.js +7 -8
  279. bp-messages/js/autocomplete/jquery.autocompletefb.min.js +1 -0
  280. {bp-core/deprecated → bp-messages}/js/autocomplete/jquery.bgiframe.js +0 -0
  281. {bp-core/deprecated → bp-messages}/js/autocomplete/jquery.bgiframe.min.js +0 -1
  282. {bp-core/deprecated → bp-messages}/js/autocomplete/jquery.dimensions.js +0 -0
  283. {bp-core/deprecated → bp-messages}/js/autocomplete/jquery.dimensions.min.js +0 -1
  284. {bp-core/deprecated → bp-messages}/js/autocomplete/license.bgiframe.txt +0 -0
  285. bp-notifications/bp-notifications-actions.php +1 -0
  286. bp-notifications/bp-notifications-adminbar.php +1 -0
  287. bp-notifications/bp-notifications-cache.php +3 -3
  288. bp-notifications/bp-notifications-functions.php +54 -14
  289. bp-notifications/bp-notifications-loader.php +2 -249
  290. bp-notifications/bp-notifications-screens.php +1 -0
  291. bp-notifications/bp-notifications-template.php +218 -448
  292. bp-notifications/classes/class-bp-notifications-component.php +291 -0
  293. bp-notifications/classes/class-bp-notifications-notification.php +12 -1
  294. bp-notifications/classes/class-bp-notifications-template.php +356 -0
  295. bp-settings/bp-settings-actions.php +81 -99
  296. bp-settings/bp-settings-functions.php +1 -0
  297. bp-settings/bp-settings-loader.php +8 -191
  298. bp-settings/bp-settings-screens.php +1 -0
  299. bp-settings/bp-settings-template.php +13 -15
  300. bp-settings/classes/class-bp-settings-component.php +218 -0
  301. bp-templates/bp-legacy/buddypress-functions.php +39 -66
  302. bp-templates/bp-legacy/buddypress/activity/entry.php +4 -1
  303. bp-templates/bp-legacy/buddypress/activity/post-form.php +8 -2
  304. bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php +4 -1
  305. bp-templates/bp-legacy/buddypress/assets/emails/single-bp-email.php +227 -0
  306. bp-templates/bp-legacy/buddypress/assets/embeds/activity.php +11 -0
  307. bp-templates/bp-legacy/buddypress/assets/embeds/footer.php +9 -0
  308. bp-templates/bp-legacy/buddypress/assets/embeds/header-activity.php +26 -0
  309. bp-templates/bp-legacy/buddypress/assets/embeds/header.php +18 -0
  310. bp-templates/bp-legacy/buddypress/groups/create.php +4 -1
  311. bp-templates/bp-legacy/buddypress/groups/index.php +12 -12
  312. bp-templates/bp-legacy/buddypress/groups/single/admin.php +22 -3
  313. bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php +2 -2
  314. bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php +4 -1
  315. bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php +4 -1
  316. bp-templates/bp-legacy/buddypress/groups/single/group-header.php +1 -1
  317. bp-templates/bp-legacy/buddypress/groups/single/request-membership.php +1 -1
  318. bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php +22 -13
  319. bp-templates/bp-legacy/buddypress/members/index.php +4 -4
  320. bp-templates/bp-legacy/buddypress/members/single/home.php +4 -1
  321. bp-templates/bp-legacy/buddypress/members/single/messages/compose.php +1 -1
  322. bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php +22 -4
  323. bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php +1 -1
  324. bp-templates/bp-legacy/buddypress/members/single/messages/single.php +14 -2
  325. bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php +8 -2
  326. bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php +4 -1
  327. bp-templates/bp-legacy/buddypress/members/single/profile/edit.php +1 -1
  328. bp-templates/bp-legacy/buddypress/members/single/settings/general.php +4 -1
  329. bp-templates/bp-legacy/css/buddypress-rtl.css +47 -36
  330. bp-templates/bp-legacy/css/buddypress-rtl.min.css +1 -1
  331. bp-templates/bp-legacy/css/buddypress.css +47 -36
  332. bp-templates/bp-legacy/css/buddypress.min.css +1 -1
  333. bp-templates/bp-legacy/css/embeds-activity-rtl.css +152 -0
  334. bp-templates/bp-legacy/css/embeds-activity-rtl.min.css +1 -0
  335. bp-templates/bp-legacy/css/embeds-activity.css +152 -0
  336. bp-templates/bp-legacy/css/embeds-activity.min.css +1 -0
  337. bp-templates/bp-legacy/css/twentyeleven-rtl.css +2025 -0
  338. bp-templates/bp-legacy/css/twentyeleven-rtl.min.css +1 -0
  339. bp-templates/bp-legacy/css/twentyeleven.css +2025 -0
  340. bp-templates/bp-legacy/css/twentyeleven.min.css +1 -0
  341. bp-templates/bp-legacy/css/twentyeleven.scss +2577 -0
  342. bp-templates/bp-legacy/css/twentyfifteen-rtl.css +39 -14
  343. bp-templates/bp-legacy/css/twentyfifteen-rtl.min.css +1 -1
  344. bp-templates/bp-legacy/css/twentyfifteen.css +39 -14
  345. bp-templates/bp-legacy/css/twentyfifteen.min.css +1 -1
  346. bp-templates/bp-legacy/css/twentyfifteen.scss +68 -41
  347. bp-templates/bp-legacy/css/twentyfourteen-rtl.css +54 -13
  348. bp-templates/bp-legacy/css/twentyfourteen-rtl.min.css +1 -1
  349. bp-templates/bp-legacy/css/twentyfourteen.css +54 -13
  350. bp-templates/bp-legacy/css/twentyfourteen.min.css +1 -1
  351. bp-templates/bp-legacy/css/twentyfourteen.scss +73 -22
  352. bp-templates/bp-legacy/css/twentysixteen-rtl.css +53 -8
  353. bp-templates/bp-legacy/css/twentysixteen-rtl.min.css +1 -1
  354. bp-templates/bp-legacy/css/twentysixteen.css +53 -8
  355. bp-templates/bp-legacy/css/twentysixteen.min.css +1 -1
  356. bp-templates/bp-legacy/css/twentysixteen.scss +77 -14
  357. bp-templates/bp-legacy/css/twentyten-rtl.css +1976 -0
  358. bp-templates/bp-legacy/css/twentyten-rtl.min.css +1 -0
  359. bp-templates/bp-legacy/css/twentyten.css +1976 -0
  360. bp-templates/bp-legacy/css/twentyten.min.css +1 -0
  361. bp-templates/bp-legacy/css/twentyten.scss +2478 -0
  362. bp-templates/bp-legacy/css/twentythirteen-rtl.css +43 -14
  363. bp-templates/bp-legacy/css/twentythirteen-rtl.min.css +1 -1
  364. bp-templates/bp-legacy/css/twentythirteen.css +43 -14
  365. bp-templates/bp-legacy/css/twentythirteen.min.css +1 -1
  366. bp-templates/bp-legacy/css/twentythirteen.scss +71 -28
  367. bp-templates/bp-legacy/css/twentytwelve-rtl.css +2013 -0
  368. bp-templates/bp-legacy/css/twentytwelve-rtl.min.css +1 -0
  369. bp-templates/bp-legacy/css/twentytwelve.css +2013 -0
  370. bp-templates/bp-legacy/css/twentytwelve.min.css +1 -0
  371. bp-templates/bp-legacy/css/twentytwelve.scss +2514 -0
  372. bp-templates/bp-legacy/js/buddypress.js +32 -16
  373. bp-templates/bp-legacy/js/buddypress.min.js +2 -3
  374. bp-templates/bp-legacy/js/password-verify.min.js +0 -1
  375. bp-themes/bp-default/groups/single/home.php +3 -0
  376. bp-xprofile/admin/js/admin.js +11 -0
  377. bp-xprofile/admin/js/admin.min.js +1 -2
  378. bp-xprofile/bp-xprofile-actions.php +5 -4
  379. bp-xprofile/bp-xprofile-activity.php +1 -12
  380. bp-xprofile/bp-xprofile-admin.php +32 -474
  381. bp-xprofile/bp-xprofile-cache.php +3 -4
  382. bp-xprofile/bp-xprofile-caps.php +0 -4
  383. bp-xprofile/bp-xprofile-classes.php +1 -0
  384. bp-xprofile/bp-xprofile-cssjs.php +12 -2
  385. bp-xprofile/bp-xprofile-filters.php +28 -23
  386. bp-xprofile/bp-xprofile-functions.php +109 -37
  387. bp-xprofile/bp-xprofile-loader.php +8 -414
  388. bp-xprofile/bp-xprofile-notifications.php +9 -3
  389. bp-xprofile/bp-xprofile-screens.php +8 -8
  390. bp-xprofile/bp-xprofile-settings.php +1 -3
  391. bp-xprofile/bp-xprofile-template.php +414 -320
  392. bp-xprofile/classes/class-bp-xprofile-component.php +450 -0
  393. bp-xprofile/classes/class-bp-xprofile-data-template.php +365 -0
  394. bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php +26 -7
  395. bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php +72 -47
  396. bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php +5 -1
  397. bp-xprofile/classes/class-bp-xprofile-field-type-number.php +5 -1
  398. bp-xprofile/classes/class-bp-xprofile-field-type-placeholder.php +1 -0
  399. bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php +12 -8
  400. bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php +5 -1
  401. bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php +1 -0
  402. bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php +5 -1
  403. bp-xprofile/classes/class-bp-xprofile-field-type-url.php +13 -10
  404. bp-xprofile/classes/class-bp-xprofile-field-type.php +19 -14
  405. bp-xprofile/classes/class-bp-xprofile-field.php +105 -43
  406. bp-xprofile/classes/class-bp-xprofile-group.php +35 -22
  407. bp-xprofile/classes/class-bp-xprofile-meta-query.php +6 -8
  408. bp-xprofile/classes/class-bp-xprofile-profiledata.php +136 -8
  409. bp-xprofile/classes/class-bp-xprofile-query.php +6 -12
  410. bp-xprofile/classes/class-bp-xprofile-user-admin.php +501 -0
  411. buddypress.pot +4260 -3312
  412. composer.json +31 -31
  413. readme.txt +35 -152
bp-activity/admin/js/admin.min.js CHANGED
@@ -1,2 +1 @@
1
- /*! buddypress - v2.4.3 - 2015-12-14 7:03:28 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
!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
@@ -6,6 +6,7 @@
6
*
7
* @package BuddyPress
8
* @subpackage ActivityActions
9
*/
10
11
// Exit if accessed directly.
@@ -16,7 +17,6 @@ defined( 'ABSPATH' ) || exit;
16
*
17
* @since 1.2.0
18
*
19
- * @uses do_action() To call 'bp_register_activity_actions' hook.
20
*/
21
function bp_register_activity_actions() {
22
@@ -34,18 +34,6 @@ add_action( 'bp_init', 'bp_register_activity_actions', 8 );
34
*
35
* @since 1.2.0
36
*
37
- * @uses bp_is_activity_component()
38
- * @uses bp_is_current_action()
39
- * @uses bp_action_variable()
40
- * @uses bp_activity_get_specific()
41
- * @uses bp_is_active()
42
- * @uses bp_core_get_user_domain()
43
- * @uses groups_get_group()
44
- * @uses bp_get_group_permalink()
45
- * @uses apply_filters_ref_array() To call the 'bp_activity_permalink_redirect_url' hook.
46
- * @uses bp_core_redirect()
47
- * @uses bp_get_root_domain()
48
- *
49
* @return bool False on failure.
50
*/
51
function bp_activity_action_permalink_router() {
@@ -105,7 +93,7 @@ function bp_activity_action_permalink_router() {
105
*
106
* @since 1.2.2
107
*
108
- * @param array Array with url to redirect to and activity related to the redirect.
109
*/
110
if ( ! $redirect = apply_filters_ref_array( 'bp_activity_permalink_redirect_url', array( $redirect, &$activity ) ) ) {
111
bp_core_redirect( bp_get_root_domain() );
@@ -121,17 +109,6 @@ add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
121
*
122
* @since 1.1.0
123
*
124
- * @uses bp_is_activity_component()
125
- * @uses bp_is_current_action()
126
- * @uses bp_action_variable()
127
- * @uses check_admin_referer()
128
- * @uses bp_activity_user_can_delete()
129
- * @uses do_action() Calls 'bp_activity_before_action_delete_activity' hook to allow actions to be taken before the activity is deleted.
130
- * @uses bp_activity_delete()
131
- * @uses bp_core_add_message()
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
*/
@@ -185,7 +162,7 @@ function bp_activity_action_delete_activity( $activity_id = 0 ) {
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
191
bp_core_redirect( wp_get_referer() );
@@ -254,7 +231,7 @@ function bp_activity_action_spam_activity( $activity_id = 0 ) {
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
260
bp_core_redirect( wp_get_referer() );
@@ -266,20 +243,6 @@ add_action( 'bp_actions', 'bp_activity_action_spam_activity' );
266
*
267
* @since 1.2.0
268
*
269
- * @uses is_user_logged_in()
270
- * @uses bp_is_activity_component()
271
- * @uses bp_is_current_action()
272
- * @uses check_admin_referer()
273
- * @uses apply_filters() To call 'bp_activity_post_update_content' hook.
274
- * @uses apply_filters() To call 'bp_activity_post_update_object' hook.
275
- * @uses apply_filters() To call 'bp_activity_post_update_item_id' hook.
276
- * @uses bp_core_add_message()
277
- * @uses bp_core_redirect()
278
- * @uses bp_activity_post_update()
279
- * @uses groups_post_update()
280
- * @uses bp_core_redirect()
281
- * @uses apply_filters() To call 'bp_activity_custom_update' hook.
282
- *
283
* @return bool False on failure.
284
*/
285
function bp_activity_action_post_update() {
@@ -370,17 +333,6 @@ add_action( 'bp_actions', 'bp_activity_action_post_update' );
370
*
371
* @since 1.2.0
372
*
373
- * @uses is_user_logged_in()
374
- * @uses bp_is_activity_component()
375
- * @uses bp_is_current_action()
376
- * @uses check_admin_referer()
377
- * @uses apply_filters() To call 'bp_activity_post_comment_activity_id' hook.
378
- * @uses apply_filters() To call 'bp_activity_post_comment_content' hook.
379
- * @uses bp_core_add_message()
380
- * @uses bp_core_redirect()
381
- * @uses bp_activity_new_comment()
382
- * @uses wp_get_referer()
383
- *
384
* @return bool False on failure.
385
*/
386
function bp_activity_action_post_comment() {
@@ -434,16 +386,6 @@ add_action( 'bp_actions', 'bp_activity_action_post_comment' );
434
*
435
* @since 1.2.0
436
*
437
- * @uses is_user_logged_in()
438
- * @uses bp_is_activity_component()
439
- * @uses bp_is_current_action()
440
- * @uses check_admin_referer()
441
- * @uses bp_activity_add_user_favorite()
442
- * @uses bp_action_variable()
443
- * @uses bp_core_add_message()
444
- * @uses bp_core_redirect()
445
- * @uses wp_get_referer()
446
- *
447
* @return bool False on failure.
448
*/
449
function bp_activity_action_mark_favorite() {
@@ -468,16 +410,6 @@ add_action( 'bp_actions', 'bp_activity_action_mark_favorite' );
468
*
469
* @since 1.2.0
470
*
471
- * @uses is_user_logged_in()
472
- * @uses bp_is_activity_component()
473
- * @uses bp_is_current_action()
474
- * @uses check_admin_referer()
475
- * @uses bp_activity_remove_user_favorite()
476
- * @uses bp_action_variable()
477
- * @uses bp_core_add_message()
478
- * @uses bp_core_redirect()
479
- * @uses wp_get_referer()
480
- *
481
* @return bool False on failure.
482
*/
483
function bp_activity_action_remove_favorite() {
@@ -502,11 +434,6 @@ add_action( 'bp_actions', 'bp_activity_action_remove_favorite' );
502
*
503
* @since 1.0.0
504
*
505
- * @uses bp_is_activity_component()
506
- * @uses bp_is_current_action()
507
- * @uses bp_is_user()
508
- * @uses status_header()
509
- *
510
* @return bool False on failure.
511
*/
512
function bp_activity_action_sitewide_feed() {
@@ -534,10 +461,6 @@ add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
534
*
535
* @since 1.0.0
536
*
537
- * @uses bp_is_user_activity()
538
- * @uses bp_is_current_action()
539
- * @uses status_header()
540
- *
541
* @return bool False on failure.
542
*/
543
function bp_activity_action_personal_feed() {
@@ -564,13 +487,6 @@ add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
564
*
565
* @since 1.0.0
566
*
567
- * @uses bp_is_active()
568
- * @uses bp_is_user_activity()
569
- * @uses bp_is_current_action()
570
- * @uses bp_get_friends_slug()
571
- * @uses bp_is_action_variable()
572
- * @uses status_header()
573
- *
574
* @return bool False on failure.
575
*/
576
function bp_activity_action_friends_feed() {
@@ -597,13 +513,6 @@ add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
597
*
598
* @since 1.2.0
599
*
600
- * @uses bp_is_active()
601
- * @uses bp_is_user_activity()
602
- * @uses bp_is_current_action()
603
- * @uses bp_get_groups_slug()
604
- * @uses bp_is_action_variable()
605
- * @uses status_header()
606
- *
607
* @return bool False on failure.
608
*/
609
function bp_activity_action_my_groups_feed() {
@@ -638,11 +547,6 @@ add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
638
*
639
* @since 1.2.0
640
*
641
- * @uses bp_is_user_activity()
642
- * @uses bp_is_current_action()
643
- * @uses bp_is_action_variable()
644
- * @uses status_header()
645
- *
646
* @return bool False on failure.
647
*/
648
function bp_activity_action_mentions_feed() {
@@ -675,11 +579,6 @@ add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
675
*
676
* @since 1.2.0
677
*
678
- * @uses bp_is_user_activity()
679
- * @uses bp_is_current_action()
680
- * @uses bp_is_action_variable()
681
- * @uses status_header()
682
- *
683
* @return bool False on failure.
684
*/
685
function bp_activity_action_favorites_feed() {
@@ -796,7 +695,28 @@ function bp_activity_catch_transition_post_type_status( $new_status, $old_status
796
if ( $new_status === $old_status ) {
797
// An edit of an existing post should update the existing activity item.
798
if ( $new_status == 'publish' ) {
799
- bp_activity_post_type_update( $post );
800
}
801
802
return;
@@ -827,6 +747,143 @@ function bp_activity_catch_transition_post_type_status( $new_status, $old_status
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
}
832
add_action( 'transition_post_status', 'bp_activity_catch_transition_post_type_status', 10, 3 );
6
*
7
* @package BuddyPress
8
* @subpackage ActivityActions
9
+ * @since 1.5.0
10
*/
11
12
// Exit if accessed directly.
17
*
18
* @since 1.2.0
19
*
20
*/
21
function bp_register_activity_actions() {
22
34
*
35
* @since 1.2.0
36
*
37
* @return bool False on failure.
38
*/
39
function bp_activity_action_permalink_router() {
93
*
94
* @since 1.2.2
95
*
96
+ * @param array $value Array with url to redirect to and activity related to the redirect.
97
*/
98
if ( ! $redirect = apply_filters_ref_array( 'bp_activity_permalink_redirect_url', array( $redirect, &$activity ) ) ) {
99
bp_core_redirect( bp_get_root_domain() );
109
*
110
* @since 1.1.0
111
*
112
* @param int $activity_id Activity id to be deleted. Defaults to 0.
113
* @return bool False on failure.
114
*/
162
do_action( 'bp_activity_action_delete_activity', $activity_id, $activity->user_id );
163
164
// Check for the redirect query arg, otherwise let WP handle things.
165
+ if ( !empty( $_GET['redirect_to'] ) )
166
bp_core_redirect( esc_url( $_GET['redirect_to'] ) );
167
else
168
bp_core_redirect( wp_get_referer() );
231
do_action( 'bp_activity_action_spam_activity', $activity_id, $activity->user_id );
232
233
// Check for the redirect query arg, otherwise let WP handle things.
234
+ if ( !empty( $_GET['redirect_to'] ) )
235
bp_core_redirect( esc_url( $_GET['redirect_to'] ) );
236
else
237
bp_core_redirect( wp_get_referer() );
243
*
244
* @since 1.2.0
245
*
246
* @return bool False on failure.
247
*/
248
function bp_activity_action_post_update() {
333
*
334
* @since 1.2.0
335
*
336
* @return bool False on failure.
337
*/
338
function bp_activity_action_post_comment() {
386
*
387
* @since 1.2.0
388
*
389
* @return bool False on failure.
390
*/
391
function bp_activity_action_mark_favorite() {
410
*
411
* @since 1.2.0
412
*
413
* @return bool False on failure.
414
*/
415
function bp_activity_action_remove_favorite() {
434
*
435
* @since 1.0.0
436
*
437
* @return bool False on failure.
438
*/
439
function bp_activity_action_sitewide_feed() {
461
*
462
* @since 1.0.0
463
*
464
* @return bool False on failure.
465
*/
466
function bp_activity_action_personal_feed() {
487
*
488
* @since 1.0.0
489
*
490
* @return bool False on failure.
491
*/
492
function bp_activity_action_friends_feed() {
513
*
514
* @since 1.2.0
515
*
516
* @return bool False on failure.
517
*/
518
function bp_activity_action_my_groups_feed() {
547
*
548
* @since 1.2.0
549
*
550
* @return bool False on failure.
551
*/
552
function bp_activity_action_mentions_feed() {
579
*
580
* @since 1.2.0
581
*
582
* @return bool False on failure.
583
*/
584
function bp_activity_action_favorites_feed() {
695
if ( $new_status === $old_status ) {
696
// An edit of an existing post should update the existing activity item.
697
if ( $new_status == 'publish' ) {
698
+ $edit = bp_activity_post_type_update( $post );
699
+
700
+ // Post was never recorded into activity stream, so record it now!
701
+ if ( null === $edit ) {
702
+ bp_activity_post_type_publish( $post->ID, $post );
703
+ }
704
+
705
+ // Allow plugins to eventually deal with other post statuses.
706
+ } else {
707
+ /**
708
+ * Fires when editing the post and the new status is not 'publish'.
709
+ *
710
+ * This is a variable filter that is dependent on the post type
711
+ * being untrashed.
712
+ *
713
+ * @since 2.5.0
714
+ *
715
+ * @param WP_Post $post Post data.
716
+ * @param string $new_status New status for the post.
717
+ * @param string $old_status Old status for the post.
718
+ */
719
+ do_action( 'bp_activity_post_type_edit_' . $post->post_type, $post, $new_status, $old_status );
720
}
721
722
return;
747
} elseif ( 'publish' === $old_status ) {
748
// Some form of pending status - only remove the activity entry.
749
bp_activity_post_type_unpublish( $post->ID, $post );
750
+
751
+ // For any other cases, allow plugins to eventually deal with it.
752
+ } else {
753
+ /**
754
+ * Fires when the old and the new post status are not 'publish'.
755
+ *
756
+ * This is a variable filter that is dependent on the post type
757
+ * being untrashed.
758
+ *
759
+ * @since 2.5.0
760
+ *
761
+ * @param WP_Post $post Post data.
762
+ * @param string $new_status New status for the post.
763
+ * @param string $old_status Old status for the post.
764
+ */
765
+ do_action( 'bp_activity_post_type_transition_status_' . $post->post_type, $post, $new_status, $old_status );
766
}
767
}
768
add_action( 'transition_post_status', 'bp_activity_catch_transition_post_type_status', 10, 3 );
769
+
770
+ /**
771
+ * When a post type comment status transition occurs, update the relevant activity's status.
772
+ *
773
+ * @since 2.5.0
774
+ *
775
+ * @param string $new_status New comment status.
776
+ * @param string $old_status Previous comment status.
777
+ * @param WP_Comment $comment Comment data.
778
+ */
779
+ function bp_activity_transition_post_type_comment_status( $new_status, $old_status, $comment ) {
780
+ $post_type = get_post_type( $comment->comment_post_ID );
781
+ if ( ! $post_type ) {
782
+ return;
783
+ }
784
+
785
+ // Get the post type tracking args.
786
+ $activity_post_object = bp_activity_get_post_type_tracking_args( $post_type );
787
+
788
+ // Bail if the activity type does not exist
789
+ if ( empty( $activity_post_object->comments_tracking->action_id ) ) {
790
+ return false;
791
+
792
+ // Set the $activity_comment_object
793
+ } else {
794
+ $activity_comment_object = $activity_post_object->comments_tracking;
795
+ }
796
+
797
+ // Init an empty activity ID
798
+ $activity_id = 0;
799
+
800
+ /**
801
+ * Activity currently doesn't have any concept of a trash, or an unapproved/approved state.
802
+ *
803
+ * If a blog comment transitions to a "delete" or "hold" status, delete the activity item.
804
+ * If a blog comment transitions to trashed, or spammed, mark the activity as spam.
805
+ * If a blog comment transitions to approved (and the activity exists), mark the activity as ham.
806
+ * If a blog comment transitions to unapproved (and the activity exists), mark the activity as spam.
807
+ * Otherwise, record the comment into the activity stream.
808
+ */
809
+
810
+ // This clause handles delete/hold.
811
+ if ( in_array( $new_status, array( 'delete', 'hold' ) ) ) {
812
+ return bp_activity_post_type_remove_comment( $comment->comment_ID, $activity_post_object );
813
+
814
+ // These clauses handle trash, spam, and un-spams.
815
+ } elseif ( in_array( $new_status, array( 'trash', 'spam', 'unapproved' ) ) ) {
816
+ $action = 'spam_activity';
817
+ } elseif ( 'approved' == $new_status ) {
818
+ $action = 'ham_activity';
819
+ }
820
+
821
+ // Get the activity
822
+ if ( bp_disable_blogforum_comments() ) {
823
+ $activity_id = bp_activity_get_activity_id( array(
824
+ 'component' => $activity_comment_object->component_id,
825
+ 'item_id' => get_current_blog_id(),
826
+ 'secondary_item_id' => $comment->comment_ID,
827
+ 'type' => $activity_comment_object->action_id,
828
+ ) );
829
+ } else {
830
+ $activity_id = get_comment_meta( $comment->comment_ID, 'bp_activity_comment_id', true );
831
+ }
832
+
833
+ /**
834
+ * Leave a chance to plugins to manage activity comments differently.
835
+ *
836
+ * @since 2.5.0
837
+ *
838
+ * @param bool $value True to override BuddyPress management.
839
+ * @param string $post_type The post type name.
840
+ * @param int $activity_id The post type activity (0 if not found).
841
+ * @param string $new_status The new status of the post type comment.
842
+ * @param string $old_status The old status of the post type comment.
843
+ * @param WP_Comment $comment Comment data.
844
+ */
845
+ if ( true === apply_filters( 'bp_activity_pre_transition_post_type_comment_status', false, $post_type, $activity_id, $new_status, $old_status, $comment ) ) {
846
+ return false;
847
+ }
848
+
849
+ // Check activity item exists
850
+ if ( empty( $activity_id ) ) {
851
+ // If no activity exists, but the comment has been approved, record it into the activity table.
852
+ if ( 'approved' == $new_status ) {
853
+ return bp_activity_post_type_comment( $comment->comment_ID, true, $activity_post_object );
854
+ }
855
+
856
+ return;
857
+ }
858
+
859
+ // Create an activity object
860
+ $activity = new BP_Activity_Activity( $activity_id );
861
+ if ( empty( $activity->component ) ) {
862
+ return;
863
+ }
864
+
865
+ // Spam/ham the activity if it's not already in that state
866
+ if ( 'spam_activity' === $action && ! $activity->is_spam ) {
867
+ bp_activity_mark_as_spam( $activity );
868
+ } elseif ( 'ham_activity' == $action) {
869
+ bp_activity_mark_as_ham( $activity );
870
+ }
871
+
872
+ // Add "new_post_type_comment" to the whitelisted activity types, so that the activity's Akismet history is generated
873
+ $post_type_comment_action = $activity_comment_object->action_id;
874
+ $comment_akismet_history = create_function( '$t', '$t[] = $post_type_comment_action; return $t;' );
875
+ add_filter( 'bp_akismet_get_activity_types', $comment_akismet_history );
876
+
877
+ // Make sure the activity change won't edit the comment if sync is on
878
+ remove_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comment', 20 );
879
+
880
+ // Save the updated activity
881
+ $activity->save();
882
+
883
+ // Restore the action
884
+ add_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comment', 20 );
885
+
886
+ // Remove the "new_blog_comment" activity type whitelist so we don't break anything
887
+ remove_filter( 'bp_akismet_get_activity_types', $comment_akismet_history );
888
+ }
889
+ add_action( 'transition_comment_status', 'bp_activity_transition_post_type_comment_status', 10, 3 );
bp-activity/bp-activity-admin.php CHANGED
@@ -16,6 +16,10 @@ defined( 'ABSPATH' ) || exit;
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 );
@@ -199,12 +203,9 @@ add_filter( 'default_hidden_meta_boxes', 'bp_activity_admin_edit_hidden_metaboxe
199
function bp_activity_admin_load() {
200
global $bp_activity_list_table;
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();
208
209
/**
210
* Fires at top of Activity admin page.
@@ -296,14 +297,22 @@ function bp_activity_admin_load() {
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
305
- ) );
306
- wp_enqueue_style( 'bp_activity_admin_css', $bp->plugin_url . "bp-activity/admin/css/admin.{$min}css", array(), bp_get_version() );
307
308
wp_style_add_data( 'bp_activity_admin_css', 'rtl', true );
309
if ( $min ) {
@@ -360,9 +369,8 @@ function bp_activity_admin_load() {
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 ) ) {
@@ -565,15 +573,15 @@ function bp_activity_admin_load() {
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
576
- $redirect_to = add_query_arg( 'updated', (int) $activity->id, $redirect_to );
577
578
/**
579
* Filters URL to redirect to after saving.
@@ -656,7 +664,7 @@ function bp_activity_admin_edit() {
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 ) ) : ?>
662
@@ -667,15 +675,23 @@ function bp_activity_admin_edit() {
667
<div id="post-body-content">
668
<div id="postdiv">
669
<div id="bp_activity_action" class="postbox">
670
- <h3><?php _e( 'Action', 'buddypress' ); ?></h3>
671
<div class="inside">
672
<?php wp_editor( stripslashes( $activity->action ), 'bp-activities-action', array( 'media_buttons' => false, 'textarea_rows' => 7, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?>
673
</div>
674
</div>
675
676
<div id="bp_activity_content" class="postbox">
677
- <h3><?php _e( 'Content', 'buddypress' ); ?></h3>
678
<div class="inside">
679
<?php wp_editor( stripslashes( $activity->content ), 'bp-activities-content', array( 'media_buttons' => false, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?>
680
</div>
681
</div>
@@ -699,10 +715,16 @@ 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 -->
@@ -776,7 +798,10 @@ function bp_activity_admin_edit_metabox_status( $item ) {
776
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
@@ -793,7 +818,10 @@ function bp_activity_admin_edit_metabox_link( $item ) {
793
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
@@ -868,7 +896,10 @@ 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>
@@ -978,7 +1009,7 @@ function bp_activity_admin_index() {
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'] ) ); ?>
984
<?php else : ?>
@@ -988,7 +1019,7 @@ function bp_activity_admin_index() {
988
<?php if ( !empty( $_REQUEST['s'] ) ) : ?>
989
<span class="subtitle"><?php printf( __( 'Search results for &#8220;%s&#8221;', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span>
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 ) ) : ?>
@@ -1010,7 +1041,11 @@ function bp_activity_admin_index() {
1010
<td colspan="4">
1011
<form method="get" action="">
1012
1013
- <h5 id="bp-replyhead"><?php _e( 'Reply to Activity', 'buddypress' ); ?></h5>
1014
<?php wp_editor( '', 'bp-activities', array( 'dfw' => false, 'media_buttons' => false, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ), 'tinymce' => false, ) ); ?>
1015
1016
<p id="bp-replysubmit" class="submit">
@@ -1032,812 +1067,3 @@ function bp_activity_admin_index() {
1032
1033
<?php
1034
}
1035
-
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.
1090
- parent::__construct( array(
1091
- 'ajax' => false,
1092
- 'plural' => 'activities',
1093
- 'singular' => 'activity',
1094
- 'screen' => get_current_screen(),
1095
- ) );
1096
- }
1097
-
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
-
1136
- // Are we doing a search?
1137
- if ( !empty( $_REQUEST['s'] ) )
1138
- $search_terms = $_REQUEST['s'];
1139
-
1140
- // Check if user has clicked on a specific activity (if so, fetch only that, and any related, activity).
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,
1148
- 'spam' => 'spam_only',
1149
- 'count_total' => 'count_query',
1150
- ) );
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,
1158
- 'in' => $include_id,
1159
- 'page' => $page,
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
- ) );
1167
-
1168
- // If we're viewing a specific activity, flatten all activities into a single array.
1169
- if ( $include_id ) {
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'],
1193
- 'total_pages' => ceil( $activities['total'] / $per_page )
1194
- ) );
1195
-
1196
- // Don't truncate activity items; bp_activity_truncate_entry() needs to be used inside a BP_Activity_Template loop.
1197
- remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
1198
- }
1199
-
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
- */
1207
- function get_column_info() {
1208
- $this->_column_headers = array(
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' );
1236
- }
1237
-
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(); ?>
1250
- </tr>
1251
- </thead>
1252
-
1253
- <tfoot>
1254
- <tr>
1255
- <?php $this->print_column_headers( false ); ?>
1256
- </tr>
1257
- </tfoot>
1258
-
1259
- <tbody id="the-comment-list">
1260
- <?php $this->display_rows_or_placeholder(); ?>
1261
- </tbody>
1262
- </table>
1263
- <?php
1264
-
1265
- $this->display_tablenav( 'bottom' );
1266
- }
1267
-
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
- */
1275
- function single_row( $item ) {
1276
- static $even = false;
1277
-
1278
- if ( $even ) {
1279
- $row_class = ' class="even"';
1280
- } else {
1281
- $row_class = ' class="alternate odd"';
1282
- }
1283
-
1284
- if ( 'activity_comment' === $item['type'] ) {
1285
- $root_id = $item['item_id'];
1286
- } else {
1287
- $root_id = $item['id'];
1288
- }
1289
-
1290
- echo '<tr' . $row_class . ' id="activity-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $root_id ) . '">';
1291
- echo $this->single_row_columns( $item );
1292
- echo '</tr>';
1293
-
1294
- $even = ! $even;
1295
- }
1296
-
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' ) ); ?>
1304
-
1305
- <ul class="subsubsub">
1306
- <li class="all"><a href="<?php echo esc_url( $url_base ); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>
1307
- <li class="spam"><a href="<?php echo esc_url( add_query_arg( array( 'activity_status' => 'spam' ), $url_base ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->spam_count ) ); ?></a></li>
1308
-
1309
- <?php
1310
-
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.
1318
- */
1319
- do_action( 'bp_activity_list_table_get_views', $url_base, $this->view ); ?>
1320
- </ul>
1321
- <?php
1322
- }
1323
-
1324
- /**
1325
- * Get bulk actions.
1326
- *
1327
- * @since 1.6.0
1328
- *
1329
- * @return array Key/value pairs for the bulk actions dropdown.
1330
- */
1331
- function get_bulk_actions() {
1332
- $actions = array();
1333
- $actions['bulk_spam'] = __( 'Mark as Spam', 'buddypress' );
1334
- $actions['bulk_ham'] = __( 'Not Spam', 'buddypress' );
1335
- $actions['bulk_delete'] = __( 'Delete Permanently', 'buddypress' );
1336
-
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
- */
1344
- return apply_filters( 'bp_activity_list_table_get_bulk_actions', $actions );
1345
- }
1346
-
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
- /**
1374
- * Get the column names for sortable columns.
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
- *
1382
- * @return array The columns that can be sorted on the Activity screen.
1383
- */
1384
- function get_sortable_columns() {
1385
- return array();
1386
-
1387
- /*return array(
1388
- 'author' => array( 'activity_author', false ), // Intentionally not using "=>"
1389
- );*/
1390
- }
1391
-
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
- }
1405
-
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 ) : ?>
1418
-
1419
- <optgroup label="<?php echo ucfirst( $component ); ?>">
1420
-
1421
- <?php foreach ( $actions as $action_key => $action_values ) : ?>
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>
1429
-
1430
- <?php endif; ?>
1431
-
1432
- <?php endforeach; ?>
1433
-
1434
- </optgroup>
1435
-
1436
- <?php endforeach; ?>
1437
-
1438
- </select>
1439
-
1440
- <?php submit_button( __( 'Filter', 'buddypress' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) ); ?>
1441
- </div>
1442
-
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
- * @param bool $always_visible Whether the actions should be always visible.
1457
- * @return string
1458
- */
1459
- public function row_actions( $actions, $always_visible = false ) {
1460
- $action_count = count( $actions );
1461
- $i = 0;
1462
-
1463
- if ( !$action_count )
1464
- return '';
1465
-
1466
- $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
1467
- foreach ( $actions as $action => $link ) {
1468
- ++$i;
1469
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
1470
- $out .= "<span class='$action'>$link$sep</span>";
1471
- }
1472
- $out .= '</div>';
1473
-
1474
- return $out;
1475
- }
1476
-
1477
- /**
1478
- * Checkbox column markup.
1479
- *
1480
- * @since 1.6.0
1481
- *
1482
- * @see WP_List_Table::single_row_columns()
1483
- *
1484
- * @param array $item A singular item (one full row).
1485
- */
1486
- function column_cb( $item ) {
1487
- printf( '<label class="screen-reader-text" for="aid-%1$d">' . __( 'Select activity item %1$d', 'buddypress' ) . '</label><input type="checkbox" name="aid[]" value="%1$d" id="aid-%1$d" />', $item['id'] );
1488
- }
1489
-
1490
- /**
1491
- * Author column markup.
1492
- *
1493
- * @since 1.6.0
1494
- *
1495
- * @see WP_List_Table::single_row_columns()
1496
- *
1497
- * @param array $item A singular item (one full row).
1498
- */
1499
- function column_author( $item ) {
1500
- echo '<strong>' . get_avatar( $item['user_id'], '32' ) . ' ' . bp_core_get_userlink( $item['user_id'] ) . '</strong>';
1501
- }
1502
-
1503
- /**
1504
- * Action column markup.
1505
- *
1506
- * @since 2.0.0
1507
- *
1508
- * @see WP_List_Table::single_row_columns()
1509
- *
1510
- * @param array $item A singular item (one full row).
1511
- */
1512
- function column_action( $item ) {
1513
- $actions = bp_activity_admin_get_activity_actions();
1514
-
1515
- if ( isset( $actions[ $item['type'] ] ) ) {
1516
- echo $actions[ $item['type'] ];
1517
- } else {
1518
- printf( __( 'Unregistered action - %s', 'buddypress' ), $item['type'] );
1519
- }
1520
- }
1521
-
1522
- /**
1523
- * Content column, and "quick admin" rollover actions.
1524
- *
1525
- * Called "comment" in the CSS so we can re-use some WP core CSS.
1526
- *
1527
- * @since 1.6.0
1528
- *
1529
- * @see WP_List_Table::single_row_columns()
1530
- *
1531
- * @param array $item A singular item (one full row).
1532
- */
1533
- function column_comment( $item ) {
1534
- // Determine what type of item (row) we're dealing with.
1535
- if ( $item['is_spam'] )
1536
- $item_status = 'spam';
1537
- else
1538
- $item_status = 'all';
1539
-
1540
- // Preorder items: Reply | Edit | Spam | Delete Permanently.
1541
- $actions = array(
1542
- 'reply' => '',
1543
- 'edit' => '',
1544
- 'spam' => '', 'unspam' => '',
1545
- 'delete' => '',
1546
- );
1547
-
1548
- // Build actions URLs.
1549
- $base_url = bp_get_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $item['id'] );
1550
- $spam_nonce = esc_html( '_wpnonce=' . wp_create_nonce( 'spam-activity_' . $item['id'] ) );
1551
-
1552
- $delete_url = $base_url . "&amp;action=delete&amp;$spam_nonce";
1553
- $edit_url = $base_url . '&amp;action=edit';
1554
- $ham_url = $base_url . "&amp;action=ham&amp;$spam_nonce";
1555
- $spam_url = $base_url . "&amp;action=spam&amp;$spam_nonce";
1556
-
1557
- // Rollover actions.
1558
- // Reply - JavaScript only; implemented by AJAX.
1559
- if ( 'spam' != $item_status ) {
1560
- if ( $this->can_comment( $item ) ) {
1561
- $actions['reply'] = sprintf( '<a href="#" class="reply hide-if-no-js">%s</a>', __( 'Reply', 'buddypress' ) );
1562
- } else {
1563
- $actions['reply'] = sprintf( '<span class="form-input-tip" title="%s">%s</span>', __( 'Replies are disabled for this activity item', 'buddypress' ), __( 'Replies disabled', 'buddypress' ) );
1564
- }
1565
-
1566
- // Edit.
1567
- $actions['edit'] = sprintf( '<a href="%s">%s</a>', $edit_url, __( 'Edit', 'buddypress' ) );
1568
- }
1569
-
1570
- // Spam/unspam.
1571
- if ( 'spam' == $item_status )
1572
- $actions['unspam'] = sprintf( '<a href="%s">%s</a>', $ham_url, __( 'Not Spam', 'buddypress' ) );
1573
- else
1574
- $actions['spam'] = sprintf( '<a href="%s">%s</a>', $spam_url, __( 'Spam', 'buddypress' ) );
1575
-
1576
- // Delete.
1577
- $actions['delete'] = sprintf( '<a href="%s" onclick="%s">%s</a>', $delete_url, "javascript:return confirm('" . esc_js( __( 'Are you sure?', 'buddypress' ) ) . "'); ", __( 'Delete Permanently', 'buddypress' ) );
1578
-
1579
- // Start timestamp.
1580
- echo '<div class="submitted-on">';
1581
-
1582
- /**
1583
- * Filters available actions for plugins to alter.
1584
- *
1585
- * @since 1.6.0
1586
- *
1587
- * @param array $actions Array of available actions user could use.
1588
- * @param array $item Current item being added to page.
1589
- */
1590
- $actions = apply_filters( 'bp_activity_admin_comment_row_actions', array_filter( $actions ), $item );
1591
-
1592
- /* translators: 2: activity admin ui date/time */
1593
- printf(
1594
- __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>', 'buddypress' ),
1595
- bp_activity_get_permalink( $item['id'] ),
1596
- date_i18n( bp_get_option( 'date_format' ), strtotime( $item['date_recorded'] ) ),
1597
- get_date_from_gmt( $item['date_recorded'], bp_get_option( 'time_format' ) )
1598
- );
1599
-
1600
- // End timestamp.
1601
- echo '</div>';
1602
-
1603
- // Get activity content - if not set, use the action.
1604
- if ( ! empty( $item['content'] ) ) {
1605
-
1606
- /**
1607
- * Filters current activity item content.
1608
- *
1609
- * @since 1.2.0
1610
- *
1611
- * @param array $item Array index holding current activity item content.
1612
- */
1613
- $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'] ) );
1614
- } else {
1615
- /**
1616
- * Filters current activity item action.
1617
- *
1618
- * @since 1.2.0
1619
- *
1620
- * @var array $item Array index holding current activity item action.
1621
- */
1622
- $content = apply_filters_ref_array( 'bp_get_activity_action', array( $item['action'] ) );
1623
- }
1624
-
1625
- /**
1626
- * Filter here to add extra output to the activity content into the Administration.
1627
- *
1628
- * @since 2.4.0
1629
- *
1630
- * @param string $content The activity content.
1631
- * @param array $item The activity object converted into an array.
1632
- */
1633
- echo apply_filters( 'bp_activity_admin_comment_content', $content, $item ) . ' ' . $this->row_actions( $actions );
1634
- }
1635
-
1636
- /**
1637
- * "In response to" column markup.
1638
- *
1639
- * @since 1.6.0
1640
- *
1641
- * @see WP_List_Table::single_row_columns()
1642
- *
1643
- * @param array $item A singular item (one full row).
1644
- */
1645
- function column_response( $item ) {
1646
-
1647
- // Is $item is a root activity?
1648
- ?>
1649
-
1650
- <div class="response-links">
1651
-
1652
- <?php
1653
- // Activity permalink
1654
- $activity_permalink = '';
1655
- if ( ! $item['is_spam'] ) {
1656
- $activity_permalink = '<a href="' . bp_activity_get_permalink( $item['id'], (object) $item ) . '" class="comments-view-item-link">' . __( 'View Activity', 'buddypress' ) . '</a>';
1657
- }
1658
-
1659
- /**
1660
- * Filters default list of default root activity types.
1661
- *
1662
- * @since 1.6.0
1663
- *
1664
- * @param array $value Array of default activity types.
1665
- * @param array $item Current item being displayed.
1666
- */
1667
- if ( empty( $item['item_id'] ) || ! in_array( $item['type'], apply_filters( 'bp_activity_admin_root_activity_types', array( 'activity_comment' ), $item ) ) ) {
1668
- echo $activity_permalink;
1669
-
1670
- $comment_count = !empty( $item['children'] ) ? bp_activity_recurse_comment_count( (object) $item ) : 0;
1671
- $root_activity_url = bp_get_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $item['id'] );
1672
-
1673
- // If the activity has comments, display a link to the activity's permalink, with its comment count in a speech bubble.
1674
- if ( $comment_count ) {
1675
- $title_attr = sprintf( _n( '%s related activity', '%s related activities', $comment_count, 'buddypress' ), number_format_i18n( $comment_count ) );
1676
- printf( '<a href="%1$s" title="%2$s" class="post-com-count post-com-count-approved"><span class="comment-count comment-count-approved">%3$s</span></a>', esc_url( $root_activity_url ), esc_attr( $title_attr ), number_format_i18n( $comment_count ) );
1677
- }
1678
-
1679
- // For non-root activities, display a link to the replied-to activity's author's profile.
1680
- } else {
1681
- echo '<strong>' . get_avatar( $this->get_activity_user_id( $item['item_id'] ), '32' ) . ' ' . bp_core_get_userlink( $this->get_activity_user_id( $item['item_id'] ) ) . '</strong><br />';
1682
- echo $activity_permalink;
1683
- }
1684
- ?>
1685
-
1686
- </div>
1687
-
1688
- <?php
1689
- }
1690
-
1691
- /**
1692
- * Allow plugins to add their custom column.
1693
- *
1694
- * @since 2.4.0
1695
- *
1696
- * @param array $item Information about the current row.
1697
- * @param string $column_name The column name.
1698
- * @return string
1699
- */
1700
- public function column_default( $item = array(), $column_name = '' ) {
1701
-
1702
- /**
1703
- * Filters a string to allow plugins to add custom column content.
1704
- *
1705
- * @since 2.4.0
1706
- *
1707
- * @param string $value Empty string.
1708
- * @param string $column_name Name of the column being rendered.
1709
- * @param array $item The current activity item in the loop.
1710
- */
1711
- return apply_filters( 'bp_activity_admin_get_custom_column', '', $column_name, $item );
1712
- }
1713
-
1714
- /**
1715
- * Get the user id associated with a given activity item.
1716
- *
1717
- * Wraps bp_activity_get_specific(), with some additional logic for
1718
- * avoiding duplicate queries.
1719
- *
1720
- * @since 1.6.0
1721
- *
1722
- * @param int $activity_id Activity ID to retrieve User ID for.
1723
- * @return int User ID of the activity item in question.
1724
- */
1725
- protected function get_activity_user_id( $activity_id ) {
1726
- // If there is an existing activity/user ID mapping, just return the user ID.
1727
- if ( ! empty( $this->activity_user_id[$activity_id] ) ) {
1728
- return $this->activity_user_id[$activity_id];
1729
-
1730
- /*
1731
- * We don't have a mapping. This means the $activity_id is not on the current
1732
- * page of results, so fetch its details from the database.
1733
- */
1734
- } else {
1735
- $activity = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'show_hidden' => true, 'spam' => 'all', ) );
1736
-
1737
- /*
1738
- * If, somehow, the referenced activity has been deleted, leaving its associated
1739
- * activities as orphans, use the logged in user's ID to avoid errors.
1740
- */
1741
- if ( empty( $activity['activities'] ) )
1742
- return bp_loggedin_user_id();
1743
-
1744
- // Store the new activity/user ID mapping for any later re-use.
1745
- $this->activity_user_id[ $activity['activities'][0]->id ] = $activity['activities'][0]->user_id;
1746
-
1747
- // Return the user ID.
1748
- return $activity['activities'][0]->user_id;
1749
- }
1750
- }
1751
-
1752
- /**
1753
- * Checks if an activity item can be replied to.
1754
- *
1755
- * This method merges functionality from {@link bp_activity_can_comment()} and
1756
- * {@link bp_blogs_disable_activity_commenting()}. This is done because the activity
1757
- * list table doesn't use a BuddyPress activity loop, which prevents those
1758
- * functions from working as intended.
1759
- *
1760
- * @since 2.0.0
1761
- *
1762
- * @param array $item An array version of the BP_Activity_Activity object.
1763
- * @return bool $can_comment
1764
- */
1765
- protected function can_comment( $item ) {
1766
- $can_comment = true;
1767
-
1768
- if ( $this->disable_blogforum_comments ) {
1769
- switch ( $item['type'] ) {
1770
- case 'new_blog_post' :
1771
- case 'new_blog_comment' :
1772
- case 'new_forum_topic' :
1773
- case 'new_forum_post' :
1774
- $can_comment = false;
1775
- break;
1776
- }
1777
-
1778
- // Activity comments supported.
1779
- } else {
1780
- // Activity comment.
1781
- if ( 'activity_comment' == $item['type'] ) {
1782
- // Blogs.
1783
- if ( bp_is_active( 'blogs' ) ) {
1784
- // Grab the parent activity entry.
1785
- $parent_activity = new BP_Activity_Activity( $item['item_id'] );
1786
-
1787
- // Fetch blog post comment depth and if the blog post's comments are open.
1788
- bp_blogs_setup_activity_loop_globals( $parent_activity );
1789
-
1790
- // Check if the activity item can be replied to.
1791
- if ( false === bp_blogs_can_comment_reply( true, $item ) ) {
1792
- $can_comment = false;
1793
- }
1794
- }
1795
-
1796
- // Blog post.
1797
- } elseif ( 'new_blog_post' == $item['type'] ) {
1798
- if ( bp_is_active( 'blogs' ) ) {
1799
- bp_blogs_setup_activity_loop_globals( (object) $item );
1800
-
1801
- if ( empty( buddypress()->blogs->allow_comments[$item['id']] ) ) {
1802
- $can_comment = false;
1803
- }
1804
- }
1805
- }
1806
- }
1807
-
1808
- /**
1809
- * Filters if an activity item can be commented on or not.
1810
- *
1811
- * @since 2.0.0
1812
- *
1813
- * @param bool $can_comment Whether an activity item can be commented on or not.
1814
- */
1815
- return apply_filters( 'bp_activity_list_table_can_comment', $can_comment );
1816
- }
1817
-
1818
- /**
1819
- * Flatten the activity array.
1820
- *
1821
- * In some cases, BuddyPress gives us a structured tree of activity
1822
- * items plus their comments. This method converts it to a flat array.
1823
- *
1824
- * @since 1.6.0
1825
- *
1826
- * @param array $tree Source array.
1827
- * @return array Flattened array.
1828
- */
1829
- public static function flatten_activity_array( $tree ){
1830
- foreach ( (array) $tree as $node ) {
1831
- if ( isset( $node->children ) ) {
1832
-
1833
- foreach ( BP_Activity_List_Table::flatten_activity_array( $node->children ) as $child ) {
1834
- $tree[] = $child;
1835
- }
1836
-
1837
- unset( $node->children );
1838
- }
1839
- }
1840
-
1841
- return $tree;
1842
- }
1843
- }
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
+ if ( ! buddypress()->do_autoload ) {
20
+ require dirname( __FILE__ ) . '/classes/class-bp-activity-list-table.php';
21
+ }
22
+
23
// Per_page screen option. Has to be hooked in extremely early.
24
if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' == $_REQUEST['page'] )
25
add_filter( 'set-screen-option', 'bp_activity_admin_screen_options', 10, 3 );
203
function bp_activity_admin_load() {
204
global $bp_activity_list_table;
205
206
+ $bp = buddypress();
207
$doaction = bp_admin_list_table_current_bulk_action();
208
+ $min = bp_core_get_minified_asset_suffix();
209
210
/**
211
* Fires at top of Activity admin page.
297
'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
298
'<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
299
);
300
+
301
+ // Add accessible hidden heading and text for Activity screen pagination.
302
+ if ( bp_get_major_wp_version() >= 4.4 ) {
303
+ get_current_screen()->set_screen_reader_content( array(
304
+ /* translators: accessibility text */
305
+ 'heading_pagination' => __( 'Activity list navigation', 'buddypress' ),
306
+ ) );
307
+ }
308
}
309
310
// Enqueue CSS and JavaScript.
311
+ 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 );
312
wp_localize_script( 'bp_activity_admin_js', 'bp_activity_admin_vars', array(
313
+ 'page' => get_current_screen()->id
314
+ ) );
315
+ wp_enqueue_style( 'bp_activity_admin_css', $bp->plugin_url . "bp-activity/admin/css/admin{$min}.css", array(), bp_get_version() );
316
317
wp_style_add_data( 'bp_activity_admin_css', 'rtl', true );
318
if ( $min ) {
369
// "We'd like to shoot the monster, could you move, please?"
370
foreach ( $activity_ids as $activity_id ) {
371
// @todo: Check the permissions on each
372
+ // if ( ! current_user_can( 'bp_edit_activity', $activity_id ) )
373
// continue;
374
// Get the activity from the database.
375
$activity = new BP_Activity_Activity( $activity_id );
376
if ( empty( $activity->component ) ) {
573
*
574
* @since 1.6.0
575
*
576
+ * @param array $value Array holding activity object and ID that holds error.
577
*/
578
do_action_ref_array( 'bp_activity_admin_edit_after', array( &$activity, $error ) );
579
580
// If an error occurred, pass back the activity ID that failed.
581
if ( $error )
582
+ $redirect_to = add_query_arg( 'error', $error, $redirect_to );
583
else
584
+ $redirect_to = add_query_arg( 'updated', $activity->id, $redirect_to );
585
586
/**
587
* Filters URL to redirect to after saving.
664
do_action_ref_array( 'bp_activity_admin_edit', array( &$activity ) ); ?>
665
666
<div class="wrap">
667
+ <h1><?php printf( __( 'Editing Activity (ID #%s)', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?></h1>
668
669
<?php if ( ! empty( $activity ) ) : ?>
670
675
<div id="post-body-content">
676
<div id="postdiv">
677
<div id="bp_activity_action" class="postbox">
678
+ <h2><?php _e( 'Action', 'buddypress' ); ?></h2>
679
<div class="inside">
680
+ <label for="bp-activities-action" class="screen-reader-text"><?php
681
+ /* translators: accessibility text */
682
+ _e( 'Edit activity action', 'buddypress' );
683
+ ?></label>
684
<?php wp_editor( stripslashes( $activity->action ), 'bp-activities-action', array( 'media_buttons' => false, 'textarea_rows' => 7, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?>
685
</div>
686
</div>
687
688
<div id="bp_activity_content" class="postbox">
689
+ <h2><?php _e( 'Content', 'buddypress' ); ?></h2>
690
<div class="inside">
691
+ <label for="bp-activities-content" class="screen-reader-text"><?php
692
+ /* translators: accessibility text */
693
+ _e( 'Edit activity content', 'buddypress' );
694
+ ?></label>
695
<?php wp_editor( stripslashes( $activity->content ), 'bp-activities-content', array( 'media_buttons' => false, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?>
696
</div>
697
</div>
715
</form>
716
717
<?php else : ?>
718
+
719
+ <p><?php
720
+ printf(
721
+ '%1$s <a href="%2$s">%3$s</a>',
722
+ __( 'No activity found with this ID.', 'buddypress' ),
723
+ esc_url( bp_get_admin_url( 'admin.php?page=bp-activity' ) ),
724
+ __( 'Go back and try again.', 'buddypress' )
725
+ );
726
+ ?></p>
727
+
728
<?php endif; ?>
729
730
</div><!-- .wrap -->
798
function bp_activity_admin_edit_metabox_link( $item ) {
799
?>
800
801
+ <label class="screen-reader-text" for="bp-activities-link"><?php
802
+ /* translators: accessibility text */
803
+ _e( 'Link', 'buddypress' );
804
+ ?></label>
805
<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" />
806
<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>
807
818
function bp_activity_admin_edit_metabox_userid( $item ) {
819
?>
820
821
+ <label class="screen-reader-text" for="bp-activities-userid"><?php
822
+ /* translators: accessibility text */
823
+ _e( 'Author ID', 'buddypress' );
824
+ ?></label>
825
<input type="number" name="bp-activities-userid" id="bp-activities-userid" value="<?php echo esc_attr( $item->user_id ); ?>" min="1" />
826
827
<?php
896
897
?>
898
899
+ <label for="bp-activities-type" class="screen-reader-text"><?php
900
+ /* translators: accessibility text */
901
+ esc_html_e( 'Select activity type', 'buddypress' );
902
+ ?></label>
903
<select name="bp-activities-type" id="bp-activities-type">
904
<?php foreach ( $actions as $k => $v ) : ?>
905
<option value="<?php echo esc_attr( $k ); ?>" <?php selected( $k, $selected ); ?>><?php echo esc_html( $v ); ?></option>
1009
do_action( 'bp_activity_admin_index', $messages ); ?>
1010
1011
<div class="wrap">
1012
+ <h1>
1013
<?php if ( !empty( $_REQUEST['aid'] ) ) : ?>
1014
<?php printf( __( 'Activity related to ID #%s', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?>
1015
<?php else : ?>
1019
<?php if ( !empty( $_REQUEST['s'] ) ) : ?>
1020
<span class="subtitle"><?php printf( __( 'Search results for &#8220;%s&#8221;', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span>
1021
<?php endif; ?>
1022
+ </h1>
1023
1024
<?php // If the user has just made a change to an activity item, display the status messages. ?>
1025
<?php if ( !empty( $messages ) ) : ?>
1041
<td colspan="4">
1042
<form method="get" action="">
1043
1044
+ <h3 id="bp-replyhead"><?php _e( 'Reply to Activity', 'buddypress' ); ?></h3>
1045
+ <label for="bp-activities" class="screen-reader-text"><?php
1046
+ /* translators: accessibility text */
1047
+ _e( 'Reply', 'buddypress' );
1048
+ ?></label>
1049
<?php wp_editor( '', 'bp-activities', array( 'dfw' => false, 'media_buttons' => false, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ), 'tinymce' => false, ) ); ?>
1050
1051
<p id="bp-replysubmit" class="submit">
1067
1068
<?php
1069
}
<