BuddyPress - Version 1.5.3

Version Description

  • Fixes 6 minor bugs/notices
  • See http://codex.buddypress.org/releases/version-1-5-3/
Download this release

Release Info

Developer dcavins
Plugin Icon 128x128 BuddyPress
Version 1.5.3
Comparing to
See all releases

Code changes from version 2.5.2 to 1.5.3

Files changed (622) hide show
  1. bp-activity/admin/css/admin-rtl.css +0 -87
  2. bp-activity/admin/css/admin-rtl.min.css +0 -1
  3. bp-activity/admin/css/admin.css +0 -87
  4. bp-activity/admin/css/admin.min.css +0 -1
  5. bp-activity/admin/js/admin.js +0 -175
  6. bp-activity/admin/js/admin.min.js +0 -2
  7. bp-activity/bp-activity-actions.php +145 -606
  8. bp-activity/bp-activity-admin.php +0 -1039
  9. bp-activity/bp-activity-akismet.php +0 -51
  10. bp-activity/bp-activity-cache.php +0 -65
  11. bp-activity/bp-activity-classes.php +551 -7
  12. bp-activity/bp-activity-cssjs.php +0 -76
  13. bp-activity/bp-activity-filters.php +88 -647
  14. bp-activity/bp-activity-functions.php +880 -3079
  15. bp-activity/bp-activity-loader.php +307 -12
  16. bp-activity/bp-activity-notifications.php +140 -312
  17. bp-activity/bp-activity-screens.php +93 -206
  18. bp-activity/bp-activity-template.php +903 -2327
  19. bp-activity/classes/class-bp-activity-activity.php +0 -1837
  20. bp-activity/classes/class-bp-activity-component.php +0 -393
  21. bp-activity/classes/class-bp-activity-feed.php +0 -468
  22. bp-activity/classes/class-bp-activity-list-table.php +0 -834
  23. bp-activity/classes/class-bp-activity-query.php +0 -247
  24. bp-activity/classes/class-bp-activity-template.php +0 -409
  25. bp-activity/classes/class-bp-activity-theme-compat.php +0 -180
  26. bp-activity/classes/class-bp-akismet.php +0 -651
  27. bp-activity/css/mentions-rtl.css +0 -93
  28. bp-activity/css/mentions-rtl.min.css +0 -1
  29. bp-activity/css/mentions.css +0 -93
  30. bp-activity/css/mentions.min.css +0 -1
  31. bp-activity/feeds/bp-activity-favorites-feed.php +74 -0
  32. bp-activity/feeds/bp-activity-friends-feed.php +64 -0
  33. bp-activity/feeds/bp-activity-group-feed.php +59 -0
  34. bp-activity/feeds/bp-activity-mentions-feed.php +64 -0
  35. bp-activity/feeds/bp-activity-mygroups-feed.php +64 -0
  36. bp-activity/feeds/bp-activity-personal-feed.php +64 -0
  37. bp-activity/feeds/bp-activity-sitewide-feed.php +59 -0
  38. bp-activity/js/mentions.js +0 -255
  39. bp-activity/js/mentions.min.js +0 -2
  40. bp-blogs/bp-blogs-actions.php +7 -25
  41. bp-blogs/bp-blogs-activity.php +53 -1262
  42. bp-blogs/bp-blogs-buddybar.php +63 -0
  43. bp-blogs/bp-blogs-cache.php +14 -45
  44. bp-blogs/bp-blogs-classes.php +281 -12
  45. bp-blogs/bp-blogs-filters.php +0 -124
  46. bp-blogs/bp-blogs-functions.php +300 -1108
  47. bp-blogs/bp-blogs-loader.php +187 -15
  48. bp-blogs/bp-blogs-screens.php +4 -41
  49. bp-blogs/bp-blogs-template.php +260 -1055
  50. bp-blogs/bp-blogs-widgets.php +84 -17
  51. bp-blogs/classes/class-bp-blogs-blog.php +0 -625
  52. bp-blogs/classes/class-bp-blogs-component.php +0 -305
  53. bp-blogs/classes/class-bp-blogs-recent-posts-widget.php +0 -163
  54. bp-blogs/classes/class-bp-blogs-template.php +0 -246
  55. bp-blogs/classes/class-bp-blogs-theme-compat.php +0 -201
  56. bp-core/admin/bp-core-admin-actions.php +0 -245
  57. bp-core/admin/bp-core-admin-classes.php +0 -13
  58. bp-core/admin/bp-core-admin-components.php +0 -449
  59. bp-core/admin/bp-core-admin-functions.php +0 -1085
  60. bp-core/admin/bp-core-admin-schema.php +0 -566
  61. bp-core/admin/bp-core-admin-settings.php +0 -409
  62. bp-core/admin/bp-core-admin-slugs.php +0 -270
  63. bp-core/admin/bp-core-admin-tools.php +0 -475
  64. bp-core/admin/bp-core-admin.php +637 -0
  65. bp-core/admin/bp-core-schema.php +300 -0
  66. bp-core/admin/bp-core-update.php +1344 -0
  67. bp-core/admin/css/common-rtl.css +0 -369
  68. bp-core/admin/css/common-rtl.min.css +0 -1
  69. bp-core/admin/css/common.css +0 -369
  70. bp-core/admin/css/common.min.css +0 -1
  71. bp-core/admin/css/customizer-controls-rtl.css +0 -10
  72. bp-core/admin/css/customizer-controls-rtl.min.css +0 -1
  73. bp-core/admin/css/customizer-controls.css +0 -10
  74. bp-core/admin/css/customizer-controls.min.css +0 -1
  75. bp-core/admin/images/autolink-feature.png +0 -0
  76. bp-core/admin/images/bp-emails-feature.png +0 -0
  77. bp-core/admin/images/emoji-feature.png +0 -0
  78. bp-core/admin/images/post-type.png +0 -0
  79. bp-core/admin/images/twentytwelve.png +0 -0
  80. bp-core/admin/js/customizer-controls.js +0 -22
  81. bp-core/admin/js/customizer-controls.min.js +0 -2
  82. bp-core/admin/js/customizer-receiver-emails.js +0 -115
  83. bp-core/admin/js/customizer-receiver-emails.min.js +0 -2
  84. bp-core/bp-core-actions.php +0 -110
  85. bp-core/bp-core-admin.php +0 -53
  86. bp-core/bp-core-adminbar.php +222 -88
  87. bp-core/bp-core-attachments.php +0 -1448
  88. bp-core/bp-core-avatars.php +464 -1670
  89. bp-core/bp-core-buddybar.php +429 -652
  90. bp-core/bp-core-cache.php +21 -224
  91. bp-core/bp-core-caps.php +0 -419
  92. bp-core/bp-core-catchuri.php +202 -671
  93. bp-core/bp-core-classes.php +1249 -27
  94. bp-core/bp-core-component.php +351 -6
  95. bp-core/bp-core-cssjs.php +83 -371
  96. bp-core/bp-core-customizer-email.php +0 -441
  97. bp-core/bp-core-dependency.php +0 -761
  98. bp-core/bp-core-filters.php +197 -984
  99. bp-core/bp-core-functions.php +997 -2822
  100. bp-core/bp-core-hooks.php +114 -0
  101. bp-core/bp-core-loader.php +232 -25
  102. bp-core/bp-core-moderation.php +0 -342
  103. bp-core/bp-core-options.php +0 -895
  104. bp-core/bp-core-taxonomy.php +0 -135
  105. bp-core/bp-core-template-loader.php +0 -568
  106. bp-core/bp-core-template.php +711 -2768
  107. bp-core/bp-core-theme-compatibility.php +0 -1017
  108. bp-core/bp-core-update.php +0 -718
  109. bp-core/bp-core-widgets.php +330 -19
  110. bp-core/bp-core-wpabstraction.php +39 -180
  111. bp-core/classes/class-bp-admin.php +0 -1049
  112. bp-core/classes/class-bp-attachment-avatar.php +0 -442
  113. bp-core/classes/class-bp-attachment-cover-image.php +0 -292
  114. bp-core/classes/class-bp-attachment.php +0 -672
  115. bp-core/classes/class-bp-button.php +0 -273
  116. bp-core/classes/class-bp-component.php +0 -858
  117. bp-core/classes/class-bp-core-login-widget.php +0 -185
  118. bp-core/classes/class-bp-core-notification.php +0 -282
  119. bp-core/classes/class-bp-core-sort-by-key-callback.php +0 -83
  120. bp-core/classes/class-bp-core-user.php +0 -959
  121. bp-core/classes/class-bp-core.php +0 -321
  122. bp-core/classes/class-bp-customizer-control-range.php +0 -57
  123. bp-core/classes/class-bp-date-query.php +0 -70
  124. bp-core/classes/class-bp-email-delivery.php +0 -31
  125. bp-core/classes/class-bp-email-recipient.php +0 -172
  126. bp-core/classes/class-bp-email.php +0 -956
  127. bp-core/classes/class-bp-embed.php +0 -260
  128. bp-core/classes/class-bp-media-extractor.php +0 -928
  129. bp-core/classes/class-bp-members-suggestions.php +0 -138
  130. bp-core/classes/class-bp-phpmailer.php +0 -156
  131. bp-core/classes/class-bp-recursive-query.php +0 -230
  132. bp-core/classes/class-bp-suggestions.php +0 -145
  133. bp-core/classes/class-bp-theme-compat.php +0 -120
  134. bp-core/classes/class-bp-user-query.php +0 -820
  135. bp-core/classes/class-bp-walker-category-checklist.php +0 -109
  136. bp-core/classes/class-bp-walker-nav-menu-checklist.php +0 -118
  137. bp-core/classes/class-bp-walker-nav-menu.php +0 -215
  138. bp-core/css/admin-bar-rtl.css +1 -58
  139. bp-core/css/admin-bar-rtl.dev.css +27 -0
  140. bp-core/css/admin-bar-rtl.min.css +0 -1
  141. bp-core/css/admin-bar.css +1 -58
  142. bp-core/css/admin-bar.dev.css +62 -0
  143. bp-core/css/admin-bar.min.css +0 -1
  144. bp-core/css/admin.css +1 -0
  145. bp-core/css/admin.dev.css +160 -0
  146. bp-core/css/avatar-rtl.css +0 -406
  147. bp-core/css/avatar-rtl.min.css +0 -1
  148. bp-core/css/avatar.css +0 -406
  149. bp-core/css/avatar.min.css +0 -1
  150. bp-core/css/buddybar-rtl.css +1 -203
  151. bp-core/css/buddybar-rtl.dev.css +77 -0
  152. bp-core/css/buddybar-rtl.min.css +0 -1
  153. bp-core/css/buddybar.css +1 -203
  154. bp-core/css/buddybar.dev.css +201 -0
  155. bp-core/css/buddybar.min.css +0 -1
  156. bp-core/deprecated/1.2.php +0 -54
  157. bp-core/deprecated/1.5.php +58 -238
  158. bp-core/deprecated/1.6.php +0 -273
  159. bp-core/deprecated/1.7.php +0 -163
  160. bp-core/deprecated/1.9.php +0 -264
  161. bp-core/deprecated/2.0.php +0 -32
  162. bp-core/deprecated/2.1.php +0 -599
  163. bp-core/deprecated/2.2.php +0 -116
  164. bp-core/deprecated/2.3.php +0 -24
  165. bp-core/deprecated/2.4.php +0 -25
  166. bp-core/deprecated/2.5.php +0 -934
  167. bp-core/images/60pc_black.png +0 -0
  168. bp-core/images/Jcrop.gif +0 -0
  169. bp-core/images/admin-bar-sprite-rtl.png +0 -0
  170. bp-core/images/admin-bar-sprite.png +0 -0
  171. bp-core/images/admin-menu-arrow.gif +0 -0
  172. bp-core/images/admin_menu_icon.png +0 -0
  173. bp-core/images/completed.gif +0 -0
  174. bp-core/images/find.png +0 -0
  175. bp-core/images/icons32.png +0 -0
  176. bp-core/images/installed.gif +0 -0
  177. bp-core/images/logo-column-header.png +0 -0
  178. bp-core/images/logo.png +0 -0
  179. bp-core/images/mystery-man-50.jpg +0 -0
  180. bp-core/images/mystery-man.jpg +0 -0
  181. bp-core/js/avatar.js +0 -682
  182. bp-core/js/avatar.min.js +0 -2
  183. bp-core/js/bp-plupload.js +0 -414
  184. bp-core/js/bp-plupload.min.js +0 -2
  185. bp-core/js/confirm.js +0 -12
  186. bp-core/js/confirm.min.js +0 -2
  187. bp-core/js/cover-image.js +0 -277
  188. bp-core/js/cover-image.min.js +0 -2
  189. bp-core/js/jquery-cookie.js +0 -120
  190. bp-core/js/jquery-cookie.min.js +0 -2
  191. bp-core/js/jquery-query.js +0 -6
  192. bp-core/js/jquery-query.min.js +0 -2
  193. bp-core/js/jquery-scroll-to.js +0 -208
  194. bp-core/js/jquery-scroll-to.min.js +0 -2
  195. bp-core/js/jquery.atwho.js +0 -875
  196. bp-core/js/jquery.atwho.min.js +0 -2
  197. bp-core/js/jquery.atwho.txt +0 -22
  198. bp-core/js/jquery.caret.js +0 -405
  199. bp-core/js/jquery.caret.min.js +0 -2
  200. bp-core/js/jquery.caret.txt +0 -22
  201. bp-core/js/update.dev.js +11 -0
  202. bp-core/js/update.js +1 -0
  203. bp-core/js/webcam.js +0 -309
  204. bp-core/js/webcam.min.js +0 -2
  205. bp-core/js/widget-members.dev.js +49 -0
  206. bp-core/js/widget-members.js +1 -49
  207. bp-core/js/widget-members.min.js +0 -2
  208. bp-forums/bb-config.php +2 -5
  209. bp-forums/bp-forums-actions.php +3 -9
  210. bp-forums/bp-forums-admin.php +363 -0
  211. bp-forums/bp-forums-bbpress-sa.php +72 -165
  212. bp-forums/bp-forums-bbpress.php +4 -7
  213. bp-forums/bp-forums-filters.php +60 -90
  214. bp-forums/bp-forums-functions.php +141 -570
  215. bp-forums/bp-forums-loader.php +102 -119
  216. bp-forums/bp-forums-screens.php +16 -205
  217. bp-forums/bp-forums-template.php +240 -1737
  218. bp-forums/deprecated/1.6.php +0 -254
  219. bp-forums/deprecated/1.7.php +0 -206
  220. bp-friends/bp-friends-actions.php +9 -23
  221. bp-friends/bp-friends-activity.php +71 -367
  222. bp-friends/bp-friends-cache.php +15 -62
  223. bp-friends/bp-friends-classes.php +339 -12
  224. bp-friends/bp-friends-filters.php +0 -73
  225. bp-friends/bp-friends-functions.php +102 -611
  226. bp-friends/bp-friends-loader.php +202 -15
  227. bp-friends/bp-friends-notifications.php +55 -282
  228. bp-friends/bp-friends-screens.php +31 -83
  229. bp-friends/bp-friends-template.php +136 -417
  230. bp-friends/bp-friends-widgets.php +0 -96
  231. bp-friends/classes/class-bp-core-friends-widget.php +0 -197
  232. bp-friends/classes/class-bp-friends-component.php +0 -270
  233. bp-friends/classes/class-bp-friends-friendship.php +0 -735
  234. bp-friends/js/widget-friends.js +0 -49
  235. bp-friends/js/widget-friends.min.js +0 -2
  236. bp-groups/admin/css/admin-rtl.css +0 -86
  237. bp-groups/admin/css/admin-rtl.min.css +0 -1
  238. bp-groups/admin/css/admin.css +0 -86
  239. bp-groups/admin/css/admin.min.css +0 -1
  240. bp-groups/admin/js/admin.js +0 -59
  241. bp-groups/admin/js/admin.min.js +0 -2
  242. bp-groups/bp-groups-actions.php +110 -345
  243. bp-groups/bp-groups-activity.php +254 -525
  244. bp-groups/bp-groups-admin.php +0 -1127
  245. bp-groups/bp-groups-adminbar.php +115 -64
  246. bp-groups/bp-groups-buddybar.php +54 -0
  247. bp-groups/bp-groups-cache.php +11 -192
  248. bp-groups/bp-groups-classes.php +1285 -10
  249. bp-groups/bp-groups-filters.php +53 -219
  250. bp-groups/bp-groups-forums.php +164 -527
  251. bp-groups/bp-groups-functions.php +363 -1245
  252. bp-groups/bp-groups-loader.php +458 -14
  253. bp-groups/bp-groups-notifications.php +216 -949
  254. bp-groups/bp-groups-screens.php +515 -1124
  255. bp-groups/bp-groups-template.php +1224 -4411
  256. bp-groups/bp-groups-widgets.php +159 -59
  257. bp-groups/classes/class-bp-group-extension.php +0 -1704
  258. bp-groups/classes/class-bp-group-member-query.php +0 -378
  259. bp-groups/classes/class-bp-groups-component.php +0 -814
  260. bp-groups/classes/class-bp-groups-group-members-template.php +0 -278
  261. bp-groups/classes/class-bp-groups-group.php +0 -1627
  262. bp-groups/classes/class-bp-groups-invite-template.php +0 -270
  263. bp-groups/classes/class-bp-groups-list-table.php +0 -641
  264. bp-groups/classes/class-bp-groups-member-suggestions.php +0 -177
  265. bp-groups/classes/class-bp-groups-member.php +0 -1204
  266. bp-groups/classes/class-bp-groups-membership-requests-template.php +0 -255
  267. bp-groups/classes/class-bp-groups-template.php +0 -397
  268. bp-groups/classes/class-bp-groups-theme-compat.php +0 -263
  269. bp-groups/classes/class-bp-groups-widget.php +0 -221
  270. bp-groups/js/widget-groups.dev.js +49 -0
  271. bp-groups/js/widget-groups.js +1 -49
  272. bp-groups/js/widget-groups.min.js +0 -2
  273. bp-languages/buddypress.pot +4983 -0
  274. bp-loader.php +96 -651
  275. bp-members/admin/bp-members-admin-classes.php +0 -19
  276. bp-members/admin/css/admin-rtl.css +0 -166
  277. bp-members/admin/css/admin-rtl.min.css +0 -1
  278. bp-members/admin/css/admin.css +0 -166
  279. bp-members/admin/css/admin.min.css +0 -1
  280. bp-members/admin/js/admin.js +0 -55
  281. bp-members/admin/js/admin.min.js +0 -2
  282. bp-members/bp-members-actions.php +101 -55
  283. bp-members/bp-members-activity.php +0 -97
  284. bp-members/bp-members-admin.php +0 -16
  285. bp-members/bp-members-adminbar.php +202 -95
  286. bp-members/bp-members-buddybar.php +135 -0
  287. bp-members/bp-members-cache.php +0 -63
  288. bp-members/bp-members-classes.php +0 -13
  289. bp-members/bp-members-filters.php +30 -84
  290. bp-members/bp-members-functions.php +364 -2404
  291. bp-members/bp-members-loader.php +183 -11
  292. bp-members/bp-members-notifications.php +131 -0
  293. bp-members/bp-members-screens.php +20 -360
  294. bp-members/bp-members-signup.php +616 -0
  295. bp-members/bp-members-template.php +471 -1545
  296. bp-members/bp-members-widgets.php +0 -110
  297. bp-members/classes/class-bp-core-members-template.php +0 -276
  298. bp-members/classes/class-bp-core-members-widget.php +0 -244
  299. bp-members/classes/class-bp-core-recently-active-widget.php +0 -167
  300. bp-members/classes/class-bp-core-whos-online-widget.php +0 -167
  301. bp-members/classes/class-bp-members-admin.php +0 -2021
  302. bp-members/classes/class-bp-members-component.php +0 -315
  303. bp-members/classes/class-bp-members-list-table.php +0 -408
  304. bp-members/classes/class-bp-members-ms-list-table.php +0 -410
  305. bp-members/classes/class-bp-members-theme-compat.php +0 -215
  306. bp-members/classes/class-bp-registration-theme-compat.php +0 -140
  307. bp-members/classes/class-bp-signup.php +0 -788
  308. bp-messages/bp-messages-actions.php +53 -414
  309. bp-messages/bp-messages-cache.php +6 -89
  310. bp-messages/bp-messages-classes.php +481 -14
  311. bp-messages/bp-messages-cssjs.php +25 -44
  312. bp-messages/bp-messages-filters.php +42 -79
  313. bp-messages/bp-messages-functions.php +115 -380
  314. bp-messages/bp-messages-loader.php +247 -13
  315. bp-messages/bp-messages-notifications.php +43 -241
  316. bp-messages/bp-messages-screens.php +90 -146
  317. bp-messages/bp-messages-star.php +0 -528
  318. bp-messages/bp-messages-template.php +428 -1583
  319. bp-messages/bp-messages-widgets.php +0 -23
  320. bp-messages/classes/class-bp-messages-box-template.php +0 -347
  321. bp-messages/classes/class-bp-messages-component.php +0 -347
  322. bp-messages/classes/class-bp-messages-message.php +0 -255
  323. bp-messages/classes/class-bp-messages-notice.php +0 -278
  324. bp-messages/classes/class-bp-messages-sitewide-notices-widget.php +0 -121
  325. bp-messages/classes/class-bp-messages-thread-template.php +0 -186
  326. bp-messages/classes/class-bp-messages-thread.php +0 -846
  327. bp-messages/css/autocomplete/jquery.autocompletefb-rtl.min.css +0 -1
  328. bp-messages/css/autocomplete/jquery.autocompletefb.css +1 -80
  329. bp-messages/css/autocomplete/{jquery.autocompletefb-rtl.css → jquery.autocompletefb.dev.css} +13 -8
  330. bp-messages/css/autocomplete/jquery.autocompletefb.min.css +0 -1
  331. bp-messages/js/autocomplete/jquery.autocomplete.dev.js +730 -0
  332. bp-messages/js/autocomplete/jquery.autocomplete.js +2 -742
  333. bp-messages/js/autocomplete/jquery.autocomplete.min.js +0 -2
  334. bp-messages/js/autocomplete/jquery.autocompletefb.dev.js +76 -0
  335. bp-messages/js/autocomplete/jquery.autocompletefb.js +2 -61
  336. bp-messages/js/autocomplete/jquery.autocompletefb.min.js +0 -2
  337. bp-messages/js/autocomplete/jquery.bgiframe.dev.js +39 -0
  338. bp-messages/js/autocomplete/jquery.bgiframe.js +2 -35
  339. bp-messages/js/autocomplete/jquery.bgiframe.min.js +0 -2
  340. bp-messages/js/autocomplete/jquery.dimensions.dev.js +117 -0
  341. bp-messages/js/autocomplete/jquery.dimensions.js +2 -106
  342. bp-messages/js/autocomplete/jquery.dimensions.min.js +0 -2
  343. bp-messages/js/autocomplete/license.bgiframe.txt +19 -19
  344. bp-notifications/bp-notifications-actions.php +0 -184
  345. bp-notifications/bp-notifications-adminbar.php +0 -63
  346. bp-notifications/bp-notifications-cache.php +0 -104
  347. bp-notifications/bp-notifications-classes.php +0 -15
  348. bp-notifications/bp-notifications-functions.php +0 -771
  349. bp-notifications/bp-notifications-loader.php +0 -25
  350. bp-notifications/bp-notifications-screens.php +0 -72
  351. bp-notifications/bp-notifications-template.php +0 -940
  352. bp-notifications/classes/class-bp-notifications-component.php +0 -266
  353. bp-notifications/classes/class-bp-notifications-notification.php +0 -1117
  354. bp-notifications/classes/class-bp-notifications-template.php +0 -356
  355. bp-settings/bp-settings-actions.php +101 -422
  356. bp-settings/bp-settings-functions.php +3 -104
  357. bp-settings/bp-settings-loader.php +185 -21
  358. bp-settings/bp-settings-screens.php +3 -98
  359. bp-settings/bp-settings-template.php +25 -66
  360. bp-settings/classes/class-bp-settings-component.php +0 -218
  361. bp-templates/bp-legacy/buddypress-functions.php +0 -1928
  362. bp-templates/bp-legacy/buddypress/activity/activity-loop.php +0 -69
  363. bp-templates/bp-legacy/buddypress/activity/comment.php +0 -70
  364. bp-templates/bp-legacy/buddypress/activity/entry.php +0 -167
  365. bp-templates/bp-legacy/buddypress/activity/index.php +0 -223
  366. bp-templates/bp-legacy/buddypress/activity/post-form.php +0 -98
  367. bp-templates/bp-legacy/buddypress/activity/single/home.php +0 -29
  368. bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php +0 -29
  369. bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/crop.php +0 -26
  370. bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/index.php +0 -47
  371. bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php +0 -36
  372. bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php +0 -39
  373. bp-templates/bp-legacy/buddypress/assets/emails/single-bp-email.php +0 -227
  374. bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php +0 -132
  375. bp-templates/bp-legacy/buddypress/blogs/create.php +0 -58
  376. bp-templates/bp-legacy/buddypress/blogs/index.php +0 -153
  377. bp-templates/bp-legacy/buddypress/forums/forums-loop.php +0 -175
  378. bp-templates/bp-legacy/buddypress/forums/index.php +0 -243
  379. bp-templates/bp-legacy/buddypress/groups/create.php +0 -476
  380. bp-templates/bp-legacy/buddypress/groups/groups-loop.php +0 -143
  381. bp-templates/bp-legacy/buddypress/groups/index.php +0 -145
  382. bp-templates/bp-legacy/buddypress/groups/single/activity.php +0 -88
  383. bp-templates/bp-legacy/buddypress/groups/single/admin.php +0 -488
  384. bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php +0 -123
  385. bp-templates/bp-legacy/buddypress/groups/single/forum.php +0 -135
  386. bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php +0 -148
  387. bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php +0 -229
  388. bp-templates/bp-legacy/buddypress/groups/single/group-header.php +0 -122
  389. bp-templates/bp-legacy/buddypress/groups/single/home.php +0 -155
  390. bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php +0 -124
  391. bp-templates/bp-legacy/buddypress/groups/single/members.php +0 -134
  392. bp-templates/bp-legacy/buddypress/groups/single/plugins.php +0 -32
  393. bp-templates/bp-legacy/buddypress/groups/single/request-membership.php +0 -45
  394. bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php +0 -89
  395. bp-templates/bp-legacy/buddypress/groups/single/send-invites.php +0 -64
  396. bp-templates/bp-legacy/buddypress/members/activate.php +0 -83
  397. bp-templates/bp-legacy/buddypress/members/index.php +0 -149
  398. bp-templates/bp-legacy/buddypress/members/members-loop.php +0 -154
  399. bp-templates/bp-legacy/buddypress/members/register.php +0 -414
  400. bp-templates/bp-legacy/buddypress/members/single/activity.php +0 -77
  401. bp-templates/bp-legacy/buddypress/members/single/blogs.php +0 -71
  402. bp-templates/bp-legacy/buddypress/members/single/cover-image-header.php +0 -103
  403. bp-templates/bp-legacy/buddypress/members/single/forums.php +0 -66
  404. bp-templates/bp-legacy/buddypress/members/single/forums/topics.php +0 -8
  405. bp-templates/bp-legacy/buddypress/members/single/friends.php +0 -79
  406. bp-templates/bp-legacy/buddypress/members/single/friends/requests.php +0 -114
  407. bp-templates/bp-legacy/buddypress/members/single/groups.php +0 -82
  408. bp-templates/bp-legacy/buddypress/members/single/groups/invites.php +0 -78
  409. bp-templates/bp-legacy/buddypress/members/single/home.php +0 -118
  410. bp-templates/bp-legacy/buddypress/members/single/member-header.php +0 -100
  411. bp-templates/bp-legacy/buddypress/members/single/messages.php +0 -92
  412. bp-templates/bp-legacy/buddypress/members/single/messages/compose.php +0 -60
  413. bp-templates/bp-legacy/buddypress/members/single/messages/message.php +0 -86
  414. bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php +0 -192
  415. bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php +0 -107
  416. bp-templates/bp-legacy/buddypress/members/single/messages/single.php +0 -168
  417. bp-templates/bp-legacy/buddypress/members/single/notifications.php +0 -36
  418. bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php +0 -38
  419. bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php +0 -44
  420. bp-templates/bp-legacy/buddypress/members/single/notifications/read.php +0 -39
  421. bp-templates/bp-legacy/buddypress/members/single/notifications/unread.php +0 -39
  422. bp-templates/bp-legacy/buddypress/members/single/plugins.php +0 -66
  423. bp-templates/bp-legacy/buddypress/members/single/profile.php +0 -72
  424. bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php +0 -92
  425. bp-templates/bp-legacy/buddypress/members/single/profile/change-cover-image.php +0 -33
  426. bp-templates/bp-legacy/buddypress/members/single/profile/edit.php +0 -123
  427. bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php +0 -76
  428. bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php +0 -114
  429. bp-templates/bp-legacy/buddypress/members/single/settings.php +0 -42
  430. bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php +0 -48
  431. bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php +0 -62
  432. bp-templates/bp-legacy/buddypress/members/single/settings/general.php +0 -59
  433. bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php +0 -53
  434. bp-templates/bp-legacy/buddypress/members/single/settings/profile.php +0 -87
  435. bp-templates/bp-legacy/css/buddypress-rtl.css +0 -1811
  436. bp-templates/bp-legacy/css/buddypress-rtl.min.css +0 -1
  437. bp-templates/bp-legacy/css/buddypress.css +0 -1811
  438. bp-templates/bp-legacy/css/buddypress.min.css +0 -1
  439. bp-templates/bp-legacy/css/twentyfifteen-rtl.css +0 -1958
  440. bp-templates/bp-legacy/css/twentyfifteen-rtl.min.css +0 -1
  441. bp-templates/bp-legacy/css/twentyfifteen.css +0 -1958
  442. bp-templates/bp-legacy/css/twentyfifteen.min.css +0 -1
  443. bp-templates/bp-legacy/css/twentyfifteen.scss +0 -2334
  444. bp-templates/bp-legacy/css/twentyfourteen-rtl.css +0 -1496
  445. bp-templates/bp-legacy/css/twentyfourteen-rtl.min.css +0 -1
  446. bp-templates/bp-legacy/css/twentyfourteen.css +0 -1496
  447. bp-templates/bp-legacy/css/twentyfourteen.min.css +0 -1
  448. bp-templates/bp-legacy/css/twentyfourteen.scss +0 -1904
  449. bp-templates/bp-legacy/css/twentysixteen-rtl.css +0 -1906
  450. bp-templates/bp-legacy/css/twentysixteen-rtl.min.css +0 -1
  451. bp-templates/bp-legacy/css/twentysixteen.css +0 -1906
  452. bp-templates/bp-legacy/css/twentysixteen.min.css +0 -1
  453. bp-templates/bp-legacy/css/twentysixteen.scss +0 -2417
  454. bp-templates/bp-legacy/css/twentythirteen-rtl.css +0 -1965
  455. bp-templates/bp-legacy/css/twentythirteen-rtl.min.css +0 -1
  456. bp-templates/bp-legacy/css/twentythirteen.css +0 -1965
  457. bp-templates/bp-legacy/css/twentythirteen.min.css +0 -1
  458. bp-templates/bp-legacy/css/twentythirteen.scss +0 -2418
  459. bp-templates/bp-legacy/css/twentytwelve-rtl.css +0 -2013
  460. bp-templates/bp-legacy/css/twentytwelve-rtl.min.css +0 -1
  461. bp-templates/bp-legacy/css/twentytwelve.css +0 -2013
  462. bp-templates/bp-legacy/css/twentytwelve.min.css +0 -1
  463. bp-templates/bp-legacy/css/twentytwelve.scss +0 -2514
  464. bp-templates/bp-legacy/js/buddypress.js +0 -2125
  465. bp-templates/bp-legacy/js/buddypress.min.js +0 -3
  466. bp-templates/bp-legacy/js/password-verify.js +0 -43
  467. bp-templates/bp-legacy/js/password-verify.min.js +0 -2
  468. bp-themes/bp-default/.jshintrc +0 -25
  469. bp-themes/bp-default/404.php +3 -3
  470. bp-themes/bp-default/_inc/ajax.php +275 -595
  471. bp-themes/bp-default/_inc/css/default-rtl.css +14 -11
  472. bp-themes/bp-default/_inc/css/default.css +21 -101
  473. bp-themes/bp-default/_inc/css/responsive.css +0 -83
  474. bp-themes/bp-default/_inc/global.js +197 -500
  475. bp-themes/bp-default/_inc/images/45pc_black.png +0 -0
  476. bp-themes/bp-default/_inc/images/60pc_black.png +0 -0
  477. bp-themes/bp-default/_inc/images/activity_arrow.gif +0 -0
  478. bp-themes/bp-default/_inc/images/admin-menu-arrow.gif +0 -0
  479. bp-themes/bp-default/_inc/images/ajax-loader.gif +0 -0
  480. bp-themes/bp-default/_inc/images/background.gif +0 -0
  481. bp-themes/bp-default/_inc/images/closed.png +0 -0
  482. bp-themes/bp-default/_inc/images/default_header.jpg +0 -0
  483. bp-themes/bp-default/_inc/images/item_back.gif +0 -0
  484. bp-themes/bp-default/_inc/images/replyto_arrow.gif +0 -0
  485. bp-themes/bp-default/_inc/images/rss.png +0 -0
  486. bp-themes/bp-default/_inc/images/sidebar_back.gif +0 -0
  487. bp-themes/bp-default/_inc/images/white-grad.png +0 -0
  488. bp-themes/bp-default/activity/activity-loop.php +3 -7
  489. bp-themes/bp-default/activity/comment.php +4 -9
  490. bp-themes/bp-default/activity/entry.php +7 -7
  491. bp-themes/bp-default/activity/index.php +14 -16
  492. bp-themes/bp-default/activity/post-form.php +3 -3
  493. bp-themes/bp-default/archive.php +9 -9
  494. bp-themes/bp-default/attachment.php +5 -5
  495. bp-themes/bp-default/blogs/create.php +4 -6
  496. bp-themes/bp-default/blogs/index.php +5 -3
  497. bp-themes/bp-default/comments.php +27 -35
  498. bp-themes/bp-default/footer.php +7 -8
  499. bp-themes/bp-default/forums/forums-loop.php +1 -1
  500. bp-themes/bp-default/forums/index.php +6 -6
  501. bp-themes/bp-default/functions.php +83 -130
  502. bp-themes/bp-default/groups/create.php +43 -40
  503. bp-themes/bp-default/groups/groups-loop.php +1 -1
  504. bp-themes/bp-default/groups/index.php +4 -2
  505. bp-themes/bp-default/groups/single/activity.php +14 -14
  506. bp-themes/bp-default/groups/single/admin.php +99 -101
  507. bp-themes/bp-default/groups/single/forum.php +14 -14
  508. bp-themes/bp-default/groups/single/forum/edit.php +25 -21
  509. bp-themes/bp-default/groups/single/forum/topic.php +91 -91
  510. bp-themes/bp-default/groups/single/group-header.php +1 -1
  511. bp-themes/bp-default/groups/single/home.php +25 -56
  512. bp-themes/bp-default/groups/single/members.php +1 -1
  513. bp-themes/bp-default/groups/single/plugins.php +11 -11
  514. bp-themes/bp-default/groups/single/request-membership.php +6 -6
  515. bp-themes/bp-default/groups/single/send-invites.php +18 -18
  516. bp-themes/bp-default/header.php +21 -16
  517. bp-themes/bp-default/index.php +13 -13
  518. bp-themes/bp-default/license.txt +280 -280
  519. bp-themes/bp-default/links.php +4 -4
  520. bp-themes/bp-default/members/index.php +3 -3
  521. bp-themes/bp-default/members/single/activity.php +10 -10
  522. bp-themes/bp-default/members/single/activity/permalink.php +3 -5
  523. bp-themes/bp-default/members/single/forums.php +1 -1
  524. bp-themes/bp-default/members/single/friends.php +6 -6
  525. bp-themes/bp-default/members/single/friends/requests.php +12 -12
  526. bp-themes/bp-default/members/single/groups.php +1 -1
  527. bp-themes/bp-default/members/single/groups/invites.php +10 -10
  528. bp-themes/bp-default/members/single/home.php +3 -4
  529. bp-themes/bp-default/members/single/member-header.php +3 -6
  530. bp-themes/bp-default/members/single/messages.php +0 -7
  531. bp-themes/bp-default/members/single/messages/compose.php +14 -14
  532. bp-themes/bp-default/members/single/messages/messages-loop.php +22 -23
  533. bp-themes/bp-default/members/single/messages/notices-loop.php +18 -23
  534. bp-themes/bp-default/members/single/messages/single.php +25 -25
  535. bp-themes/bp-default/members/single/notifications.php +0 -39
  536. bp-themes/bp-default/members/single/notifications/feedback-no-notifications.php +0 -29
  537. bp-themes/bp-default/members/single/notifications/notifications-loop.php +0 -25
  538. bp-themes/bp-default/members/single/notifications/read.php +0 -29
  539. bp-themes/bp-default/members/single/notifications/unread.php +0 -29
  540. bp-themes/bp-default/members/single/profile.php +11 -5
  541. bp-themes/bp-default/members/single/profile/change-avatar.php +16 -16
  542. bp-themes/bp-default/members/single/profile/edit.php +8 -37
  543. bp-themes/bp-default/members/single/profile/profile-wp.php +5 -5
  544. bp-themes/bp-default/members/single/settings.php +3 -4
  545. bp-themes/bp-default/members/single/settings/capabilities.php +0 -81
  546. bp-themes/bp-default/members/single/settings/delete-account.php +9 -23
  547. bp-themes/bp-default/members/single/settings/general.php +8 -11
  548. bp-themes/bp-default/members/single/settings/notifications.php +7 -6
  549. bp-themes/bp-default/members/single/settings/profile.php +0 -112
  550. bp-themes/bp-default/onecolumn-page.php +4 -4
  551. bp-themes/bp-default/page.php +4 -4
  552. bp-themes/bp-default/readme.txt +21 -21
  553. bp-themes/bp-default/registration/activate.php +16 -18
  554. bp-themes/bp-default/registration/register.php +85 -121
  555. bp-themes/bp-default/rtl.css +1 -1
  556. bp-themes/bp-default/screenshot.png +0 -0
  557. bp-themes/bp-default/search.php +13 -13
  558. bp-themes/bp-default/searchform.php +5 -5
  559. bp-themes/bp-default/sidebar-footer.php +37 -44
  560. bp-themes/bp-default/sidebar.php +22 -25
  561. bp-themes/bp-default/single.php +6 -6
  562. bp-themes/bp-default/style.css +3 -5
  563. bp-xprofile/admin/css/admin-rtl.css +0 -286
  564. bp-xprofile/admin/css/admin-rtl.min.css +0 -1
  565. bp-xprofile/admin/css/admin.css +1 -286
  566. bp-xprofile/admin/css/admin.dev.css +266 -0
  567. bp-xprofile/admin/css/admin.min.css +0 -1
  568. bp-xprofile/admin/images/cross.gif +0 -0
  569. bp-xprofile/admin/images/move-x.gif +0 -0
  570. bp-xprofile/admin/images/move.gif +0 -0
  571. bp-xprofile/admin/images/move.png +0 -0
  572. bp-xprofile/admin/images/plus.gif +0 -0
  573. bp-xprofile/admin/js/admin.dev.js +218 -0
  574. bp-xprofile/admin/js/admin.js +1 -327
  575. bp-xprofile/admin/js/admin.min.js +0 -2
  576. bp-xprofile/bp-xprofile-actions.php +18 -105
  577. bp-xprofile/bp-xprofile-activity.php +70 -283
  578. bp-xprofile/bp-xprofile-admin.php +245 -453
  579. bp-xprofile/bp-xprofile-buddybar.php +4 -0
  580. bp-xprofile/bp-xprofile-cache.php +16 -296
  581. bp-xprofile/bp-xprofile-caps.php +0 -70
  582. bp-xprofile/bp-xprofile-classes.php +1051 -27
  583. bp-xprofile/bp-xprofile-cssjs.php +17 -62
  584. bp-xprofile/bp-xprofile-filters.php +96 -485
  585. bp-xprofile/bp-xprofile-functions.php +303 -944
  586. bp-xprofile/bp-xprofile-loader.php +223 -14
  587. bp-xprofile/bp-xprofile-notifications.php +0 -55
  588. bp-xprofile/bp-xprofile-screens.php +61 -232
  589. bp-xprofile/bp-xprofile-settings.php +0 -61
  590. bp-xprofile/bp-xprofile-template.php +497 -974
  591. bp-xprofile/classes/class-bp-xprofile-component.php +0 -436
  592. bp-xprofile/classes/class-bp-xprofile-data-template.php +0 -344
  593. bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php +0 -209
  594. bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php +0 -327
  595. bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php +0 -209
  596. bp-xprofile/classes/class-bp-xprofile-field-type-number.php +0 -113
  597. bp-xprofile/classes/class-bp-xprofile-field-type-placeholder.php +0 -63
  598. bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php +0 -197
  599. bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php +0 -189
  600. bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php +0 -173
  601. bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php +0 -114
  602. bp-xprofile/classes/class-bp-xprofile-field-type-url.php +0 -171
  603. bp-xprofile/classes/class-bp-xprofile-field-type.php +0 -487
  604. bp-xprofile/classes/class-bp-xprofile-field.php +0 -1559
  605. bp-xprofile/classes/class-bp-xprofile-group.php +0 -812
  606. bp-xprofile/classes/class-bp-xprofile-meta-query.php +0 -366
  607. bp-xprofile/classes/class-bp-xprofile-profiledata.php +0 -619
  608. bp-xprofile/classes/class-bp-xprofile-query.php +0 -532
  609. bp-xprofile/classes/class-bp-xprofile-user-admin.php +0 -479
  610. buddypress.pot +0 -8981
  611. composer.json +0 -33
  612. humans.txt +8 -38
  613. license.txt +280 -280
  614. readme.txt +113 -331
  615. screenshot-1.gif +0 -0
  616. screenshot-2.gif +0 -0
  617. screenshot-3.gif +0 -0
  618. screenshot-4.gif +0 -0
  619. screenshot-5.gif +0 -0
  620. screenshot-6.gif +0 -0
  621. screenshot-7.gif +0 -0
  622. screenshot-8.gif +0 -0
bp-activity/admin/css/admin-rtl.css DELETED
@@ -1,87 +0,0 @@
1
- .akismet-status {
2
- float: left;
3
- }
4
- .akismet-status a {
5
- color: #AAA;
6
- font-style: italic;
7
- }
8
- .akismet-history {
9
- margin: 13px;
10
- }
11
- .akismet-history div {
12
- margin-bottom: 13px;
13
- }
14
- .akismet-history span {
15
- color: #999;
16
- }
17
-
18
- #wp-bp-activities-wrap {
19
- padding: 5px 0;
20
- }
21
- #bp-activities {
22
- height: 120px;
23
- }
24
- #bp-replyhead {
25
- font-size: 1em;
26
- line-height: 1.4em;
27
- margin: 0;
28
- }
29
- #bp-replysubmit {
30
- margin: 0;
31
- padding: 0 0 3px;
32
- text-align: center;
33
- }
34
- #bp-replysubmit .error {
35
- color: red;
36
- line-height: 21px;
37
- text-align: center;
38
- vertical-align: center;
39
- }
40
- #bp-replysubmit img.waiting {
41
- float: left;
42
- padding: 4px 10px 0;
43
- vertical-align: top;
44
- }
45
- #bp-activities-form .column-response img {
46
- float: right;
47
- margin-bottom: 5px;
48
- margin-left: 10px;
49
- margin-top: 1px;
50
- }
51
- .activity-errors {
52
- list-style-type: disc;
53
- margin-right: 2em;
54
- }
55
-
56
- #bp_activity_action div.inside,
57
- #bp_activity_content div.inside {
58
- line-height: 0;
59
- }
60
- #bp_activity_action h3,
61
- #bp_activity_content h3 {
62
- cursor: auto;
63
- }
64
- #bp_activity_action td.mceIframeContainer,
65
- #bp_activity_content td.mceIframeContainer {
66
- background-color: white;
67
- }
68
- #post-body #bp-activities-action_resize,
69
- #post-body #bp-activities-content_resize {
70
- position: inherit;
71
- margin-top: -2px;
72
- }
73
- #bp_activity_link input {
74
- width: 99%;
75
- }
76
- #bp-activities-primaryid {
77
- margin-bottom: 1em;
78
- }
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
- }
bp-activity/admin/css/admin-rtl.min.css DELETED
@@ -1 +0,0 @@
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}}
bp-activity/admin/css/admin.css DELETED
@@ -1,87 +0,0 @@
1
- .akismet-status {
2
- float: right;
3
- }
4
- .akismet-status a {
5
- color: #AAA;
6
- font-style: italic;
7
- }
8
- .akismet-history {
9
- margin: 13px;
10
- }
11
- .akismet-history div {
12
- margin-bottom: 13px;
13
- }
14
- .akismet-history span {
15
- color: #999;
16
- }
17
-
18
- #wp-bp-activities-wrap {
19
- padding: 5px 0;
20
- }
21
- #bp-activities {
22
- height: 120px;
23
- }
24
- #bp-replyhead {
25
- font-size: 1em;
26
- line-height: 1.4em;
27
- margin: 0;
28
- }
29
- #bp-replysubmit {
30
- margin: 0;
31
- padding: 0 0 3px;
32
- text-align: center;
33
- }
34
- #bp-replysubmit .error {
35
- color: red;
36
- line-height: 21px;
37
- text-align: center;
38
- vertical-align: center;
39
- }
40
- #bp-replysubmit img.waiting {
41
- float: right;
42
- padding: 4px 10px 0;
43
- vertical-align: top;
44
- }
45
- #bp-activities-form .column-response img {
46
- float: left;
47
- margin-bottom: 5px;
48
- margin-right: 10px;
49
- margin-top: 1px;
50
- }
51
- .activity-errors {
52
- list-style-type: disc;
53
- margin-left: 2em;
54
- }
55
-
56
- #bp_activity_action div.inside,
57
- #bp_activity_content div.inside {
58
- line-height: 0;
59
- }
60
- #bp_activity_action h3,
61
- #bp_activity_content h3 {
62
- cursor: auto;
63
- }
64
- #bp_activity_action td.mceIframeContainer,
65
- #bp_activity_content td.mceIframeContainer {
66
- background-color: white;
67
- }
68
- #post-body #bp-activities-action_resize,
69
- #post-body #bp-activities-content_resize {
70
- position: inherit;
71
- margin-top: -2px;
72
- }
73
- #bp_activity_link input {
74
- width: 99%;
75
- }
76
- #bp-activities-primaryid {
77
- margin-bottom: 1em;
78
- }
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
- }
bp-activity/admin/css/admin.min.css DELETED
@@ -1 +0,0 @@
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}}
bp-activity/admin/js/admin.js DELETED
@@ -1,175 +0,0 @@
1
- /* global bp_activity_admin_vars, postboxes, wpAjax */
2
- (function( $ ) {
3
-
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 );
18
- $(document).on( 'click', '#bp-activities-container a.cancel', activityReply.close );
19
- $(document).on( 'click', '#bp-activities-container a.save', activityReply.send );
20
-
21
- // Close textarea on escape
22
- $(document).on( 'keyup', '#bp-activities:visible', function( e ) {
23
- if ( 27 === e.which ) {
24
- activityReply.close();
25
- }
26
- });
27
- },
28
-
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
36
- var box = $( '#bp-activities-container' ).hide();
37
- $( this ).parents( 'tr' ).after( box );
38
-
39
- // Fade the whole row in, and set focus on the text area.
40
- box.fadeIn( '300' );
41
- $( '#bp-activities' ).focus();
42
-
43
- return false;
44
- },
45
-
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
53
- $('#bp-activities-container').fadeOut( '200', function () {
54
-
55
- // Empty and unfocus the text area
56
- $( '#bp-activities' ).val( '' ).blur();
57
-
58
- // Remove any error message and disable the spinner
59
- $( '#bp-replysubmit .error' ).html( '' ).hide();
60
- $( '#bp-replysubmit .waiting' ).hide();
61
- });
62
-
63
- return false;
64
- },
65
-
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
73
- $( '#bp-replysubmit .error' ).hide();
74
- $( '#bp-replysubmit .waiting' ).show();
75
-
76
- // Grab the nonce
77
- var reply = {};
78
- reply['_ajax_nonce-bp-activity-admin-reply'] = $( '#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]' ).val();
79
-
80
- // Get the rest of the data
81
- reply.action = 'bp-activity-admin-reply';
82
- reply.content = $( '#bp-activities' ).val();
83
- reply.parent_id = $( '#bp-activities-container' ).prev().data( 'parent_id' );
84
- reply.root_id = $( '#bp-activities-container' ).prev().data( 'root_id' );
85
-
86
- // Make the AJAX call
87
- $.ajax({
88
- data : reply,
89
- type : 'POST',
90
- url : ajaxurl,
91
-
92
- // Callbacks
93
- error : function( r ) { activityReply.error( r ); },
94
- success : function( r ) { activityReply.show( r ); }
95
- });
96
-
97
- return false;
98
- },
99
-
100
- /**
101
- * send() error message handler
102
- *
103
- * @since 1.6.0
104
- */
105
- error : function( r ) {
106
- var er = r.statusText;
107
- $('#bp-replysubmit .waiting').hide();
108
-
109
- if ( r.responseText ) {
110
- er = r.responseText.replace( /<.[^<>]*?>/g, '' );
111
- }
112
-
113
- if ( er ) {
114
- $('#bp-replysubmit .error').html( er ).show();
115
- }
116
- },
117
-
118
- /**
119
- * send() success handler
120
- *
121
- * @since 1.6.0
122
- */
123
- show : function ( xml ) {
124
- var bg, id, response;
125
-
126
- // Handle any errors in the response
127
- if ( typeof( xml ) === 'string' ) {
128
- activityReply.error( { 'responseText': xml } );
129
- return false;
130
- }
131
-
132
- response = wpAjax.parseAjaxResponse( xml );
133
- if ( response.errors ) {
134
- activityReply.error( { 'responseText': wpAjax.broken } );
135
- return false;
136
- }
137
- response = response.responses[0];
138
-
139
- // Close and reset the reply row, and add the new Activity item into the list.
140
- $('#bp-activities-container').fadeOut( '200', function () {
141
-
142
- // Empty and unfocus the text area
143
- $( '#bp-activities' ).val( '' ).blur();
144
-
145
- // Remove any error message and disable the spinner
146
- $( '#bp-replysubmit .error' ).html( '' ).hide();
147
- $( '#bp-replysubmit .waiting' ).hide();
148
-
149
- // Insert new activity item
150
- $( '#bp-activities-container' ).before( response.data );
151
-
152
- // Get background colour and animate the flash
153
- id = $( '#activity-' + response.id );
154
- bg = id.closest( '.widefat' ).css( 'backgroundColor' );
155
- id.animate( { 'backgroundColor': '#CEB' }, 300 ).animate( { 'backgroundColor': bg }, 300 );
156
- });
157
- }
158
- };
159
-
160
- $(document).ready( function () {
161
- // Create the Activity reply object after domready event
162
- activityReply.init();
163
-
164
- // On the edit screen, unload the close/open toggle js for the action & content metaboxes
165
- $( '#bp_activity_action h3, #bp_activity_content h3' ).unbind( 'click' );
166
-
167
- // redo the post box toggles to reset the one made by comment.js in favor
168
- // of activity administration page id so that metaboxes are still collapsible
169
- // in single Activity Administration screen.
170
- if ( typeof postboxes !== 'undefined' ) {
171
- postboxes.add_postbox_toggles( bp_activity_admin_vars.page );
172
- }
173
- });
174
-
175
- })(jQuery);
bp-activity/admin/js/admin.min.js DELETED
@@ -1,2 +0,0 @@
1
- /*! buddypress - v2.5.2 - 2016-03-31 7:09:08 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
@@ -6,35 +7,29 @@
6
*
7
* @package BuddyPress
8
* @subpackage ActivityActions
9
- * @since 1.5.0
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 1.2.0
19
*
20
* @uses do_action() To call 'bp_register_activity_actions' hook.
21
*/
22
function bp_register_activity_actions() {
23
-
24
- /**
25
- * Fires on bp_init to allow core components and dependent plugins to register activity actions.
26
- *
27
- * @since 1.2.0
28
- */
29
do_action( 'bp_register_activity_actions' );
30
}
31
add_action( 'bp_init', 'bp_register_activity_actions', 8 );
32
33
/**
34
- * Catch and route requests for single activity item permalinks.
35
*
36
* @since 1.2.0
37
*
38
* @uses bp_is_activity_component()
39
* @uses bp_is_current_action()
40
* @uses bp_action_variable()
@@ -43,76 +38,64 @@ add_action( 'bp_init', 'bp_register_activity_actions', 8 );
43
* @uses bp_core_get_user_domain()
44
* @uses groups_get_group()
45
* @uses bp_get_group_permalink()
46
- * @uses apply_filters_ref_array() To call the 'bp_activity_permalink_redirect_url' hook.
47
* @uses bp_core_redirect()
48
* @uses bp_get_root_domain()
49
*
50
- * @return bool False on failure.
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
66
if ( empty( $activity['activities'][0] ) ) {
67
bp_do_404();
68
return;
69
} else {
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 );
101
- $redirect = add_query_arg( urlencode_deep( $query_frags ), $redirect );
102
}
103
104
- /**
105
- * Filter the intended redirect url before the redirect occurs for the single activity item.
106
- *
107
- * @since 1.2.2
108
- *
109
- * @param array $value Array with url to redirect to and activity related to the redirect.
110
- */
111
- if ( ! $redirect = apply_filters_ref_array( 'bp_activity_permalink_redirect_url', array( $redirect, &$activity ) ) ) {
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' );
@@ -122,6 +105,9 @@ add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
122
*
123
* @since 1.1.0
124
*
125
* @uses bp_is_activity_component()
126
* @uses bp_is_current_action()
127
* @uses bp_action_variable()
@@ -133,140 +119,57 @@ add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
133
* @uses do_action() Calls 'bp_activity_action_delete_activity' hook to allow actions to be taken after the activity is deleted.
134
* @uses bp_core_redirect()
135
*
136
- * @param int $activity_id Activity id to be deleted. Defaults to 0.
137
- * @return bool False on failure.
138
*/
139
function bp_activity_action_delete_activity( $activity_id = 0 ) {
140
141
- // Not viewing activity or action is not delete.
142
if ( !bp_is_activity_component() || !bp_is_current_action( 'delete' ) )
143
return false;
144
145
if ( empty( $activity_id ) && bp_action_variable( 0 ) )
146
$activity_id = (int) bp_action_variable( 0 );
147
148
- // Not viewing a specific activity item.
149
if ( empty( $activity_id ) )
150
return false;
151
152
- // Check the nonce.
153
check_admin_referer( 'bp_activity_delete_link' );
154
155
- // Load up the activity item.
156
$activity = new BP_Activity_Activity( $activity_id );
157
158
- // Check access.
159
- if ( ! bp_activity_user_can_delete( $activity ) )
160
return false;
161
162
- /**
163
- * Fires before the deletion so plugins can still fetch information about it.
164
- *
165
- * @since 1.5.0
166
- *
167
- * @param int $activity_id The activity ID.
168
- * @param int $user_id The user associated with the activity.
169
- */
170
do_action( 'bp_activity_before_action_delete_activity', $activity_id, $activity->user_id );
171
172
- // Delete the activity item and provide user feedback.
173
if ( bp_activity_delete( array( 'id' => $activity_id, 'user_id' => $activity->user_id ) ) )
174
bp_core_add_message( __( 'Activity deleted successfully', 'buddypress' ) );
175
else
176
bp_core_add_message( __( 'There was an error when deleting that activity', 'buddypress' ), 'error' );
177
178
- /**
179
- * Fires after the deletion so plugins can act afterwards based on the activity.
180
- *
181
- * @since 1.1.0
182
- *
183
- * @param int $activity_id The activity ID.
184
- * @param int $user_id The user associated with the activity.
185
- */
186
do_action( 'bp_activity_action_delete_activity', $activity_id, $activity->user_id );
187
188
- // Check for the redirect query arg, otherwise let WP handle things.
189
- if ( !empty( $_GET['redirect_to'] ) )
190
bp_core_redirect( esc_url( $_GET['redirect_to'] ) );
191
else
192
bp_core_redirect( wp_get_referer() );
193
}
194
add_action( 'bp_actions', 'bp_activity_action_delete_activity' );
195
196
- /**
197
- * Mark specific activity item as spam and redirect to previous page.
198
- *
199
- * @since 1.6.0
200
- *
201
- * @param int $activity_id Activity id to be deleted. Defaults to 0.
202
- * @return bool False on failure.
203
- */
204
- function bp_activity_action_spam_activity( $activity_id = 0 ) {
205
- $bp = buddypress();
206
-
207
- // Not viewing activity, or action is not spam, or Akismet isn't present.
208
- if ( !bp_is_activity_component() || !bp_is_current_action( 'spam' ) || empty( $bp->activity->akismet ) )
209
- return false;
210
-
211
- if ( empty( $activity_id ) && bp_action_variable( 0 ) )
212
- $activity_id = (int) bp_action_variable( 0 );
213
-
214
- // Not viewing a specific activity item.
215
- if ( empty( $activity_id ) )
216
- return false;
217
-
218
- // Is the current user allowed to spam items?
219
- if ( !bp_activity_user_can_mark_spam() )
220
- return false;
221
-
222
- // Load up the activity item.
223
- $activity = new BP_Activity_Activity( $activity_id );
224
- if ( empty( $activity->id ) )
225
- return false;
226
-
227
- // Check nonce.
228
- check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id );
229
-
230
- /**
231
- * Fires before the marking activity as spam so plugins can modify things if they want to.
232
- *
233
- * @since 1.6.0
234
- *
235
- * @param int $activity_id Activity ID to be marked as spam.
236
- * @param object $activity Activity object for the ID to be marked as spam.
237
- */
238
- do_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity );
239
-
240
- // Mark as spam.
241
- bp_activity_mark_as_spam( $activity );
242
- $activity->save();
243
-
244
- // Tell the user the spamming has been successful.
245
- bp_core_add_message( __( 'The activity item has been marked as spam and is no longer visible.', 'buddypress' ) );
246
-
247
- /**
248
- * Fires after the marking activity as spam so plugins can act afterwards based on the activity.
249
- *
250
- * @since 1.6.0
251
- *
252
- * @param int $activity_id Activity ID that was marked as spam.
253
- * @param int $user_id User ID associated with activity.
254
- */
255
- do_action( 'bp_activity_action_spam_activity', $activity_id, $activity->user_id );
256
-
257
- // Check for the redirect query arg, otherwise let WP handle things.
258
- if ( !empty( $_GET['redirect_to'] ) )
259
- bp_core_redirect( esc_url( $_GET['redirect_to'] ) );
260
- else
261
- bp_core_redirect( wp_get_referer() );
262
- }
263
- add_action( 'bp_actions', 'bp_activity_action_spam_activity' );
264
-
265
/**
266
* Post user/group activity update.
267
*
268
* @since 1.2.0
269
*
270
* @uses is_user_logged_in()
271
* @uses bp_is_activity_component()
272
* @uses bp_is_current_action()
@@ -281,87 +184,51 @@ add_action( 'bp_actions', 'bp_activity_action_spam_activity' );
281
* @uses bp_core_redirect()
282
* @uses apply_filters() To call 'bp_activity_custom_update' hook.
283
*
284
- * @return bool False on failure.
285
*/
286
function bp_activity_action_post_update() {
287
288
- // Do not proceed if user is not logged in, not viewing activity, or not posting.
289
if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'post' ) )
290
return false;
291
292
- // Check the nonce.
293
check_admin_referer( 'post_update', '_wpnonce_post_update' );
294
295
- /**
296
- * Filters the content provided in the activity input field.
297
- *
298
- * @since 1.2.0
299
- *
300
- * @param string $value Activity message being posted.
301
- */
302
- $content = apply_filters( 'bp_activity_post_update_content', $_POST['whats-new'] );
303
-
304
- if ( ! empty( $_POST['whats-new-post-object'] ) ) {
305
-
306
- /**
307
- * Filters the item type that the activity update should be associated with.
308
- *
309
- * @since 1.2.0
310
- *
311
- * @param string $value Item type to associate with.
312
- */
313
- $object = apply_filters( 'bp_activity_post_update_object', $_POST['whats-new-post-object'] );
314
- }
315
-
316
- if ( ! empty( $_POST['whats-new-post-in'] ) ) {
317
-
318
- /**
319
- * Filters what component the activity is being to.
320
- *
321
- * @since 1.2.0
322
- *
323
- * @param string $value Chosen component to post activity to.
324
- */
325
- $item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in'] );
326
- }
327
328
- // No activity content so provide feedback and redirect.
329
if ( empty( $content ) ) {
330
bp_core_add_message( __( 'Please enter some content to post.', 'buddypress' ), 'error' );
331
bp_core_redirect( wp_get_referer() );
332
}
333
334
- // No existing item_id.
335
if ( empty( $item_id ) ) {
336
$activity_id = bp_activity_post_update( array( 'content' => $content ) );
337
338
- // Post to groups object.
339
- } elseif ( 'groups' == $object && bp_is_active( 'groups' ) ) {
340
- if ( (int) $item_id ) {
341
$activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) );
342
}
343
344
} else {
345
-
346
- /**
347
- * Filters activity object for BuddyPress core and plugin authors before posting activity update.
348
- *
349
- * @since 1.2.0
350
- *
351
- * @param string $object Activity item being associated to.
352
- * @param string $item_id Component ID being posted to.
353
- * @param string $content Activity content being posted.
354
- */
355
$activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );
356
}
357
358
- // Provide user feedback.
359
if ( !empty( $activity_id ) )
360
bp_core_add_message( __( 'Update Posted!', 'buddypress' ) );
361
else
362
- bp_core_add_message( __( 'There was an error when posting your update. Please try again.', 'buddypress' ), 'error' );
363
364
- // Redirect.
365
bp_core_redirect( wp_get_referer() );
366
}
367
add_action( 'bp_actions', 'bp_activity_action_post_update' );
@@ -371,6 +238,7 @@ add_action( 'bp_actions', 'bp_activity_action_post_update' );
371
*
372
* @since 1.2.0
373
*
374
* @uses is_user_logged_in()
375
* @uses bp_is_activity_component()
376
* @uses bp_is_current_action()
@@ -382,32 +250,18 @@ add_action( 'bp_actions', 'bp_activity_action_post_update' );
382
* @uses bp_activity_new_comment()
383
* @uses wp_get_referer()
384
*
385
- * @return bool False on failure.
386
*/
387
function bp_activity_action_post_comment() {
388
389
- if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'reply' ) )
390
return false;
391
392
- // Check the nonce.
393
check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );
394
395
- /**
396
- * Filters the activity ID a comment will be in reply to.
397
- *
398
- * @since 1.2.0
399
- *
400
- * @param string $value ID of the activity being replied to.
401
- */
402
$activity_id = apply_filters( 'bp_activity_post_comment_activity_id', $_POST['comment_form_id'] );
403
-
404
- /**
405
- * Filters the comment content for a comment reply.
406
- *
407
- * @since 1.2.0
408
- *
409
- * @param string $value Comment content being posted.
410
- */
411
$content = apply_filters( 'bp_activity_post_comment_content', $_POST['ac_input_' . $activity_id] );
412
413
if ( empty( $content ) ) {
@@ -416,15 +270,15 @@ function bp_activity_action_post_comment() {
416
}
417
418
$comment_id = bp_activity_new_comment( array(
419
- 'content' => $content,
420
'activity_id' => $activity_id,
421
- 'parent_id' => false
422
));
423
424
if ( !empty( $comment_id ) )
425
bp_core_add_message( __( 'Reply Posted!', 'buddypress' ) );
426
else
427
- bp_core_add_message( __( 'There was an error posting that reply. Please try again.', 'buddypress' ), 'error' );
428
429
bp_core_redirect( wp_get_referer() . '#ac-form-' . $activity_id );
430
}
@@ -435,6 +289,7 @@ add_action( 'bp_actions', 'bp_activity_action_post_comment' );
435
*
436
* @since 1.2.0
437
*
438
* @uses is_user_logged_in()
439
* @uses bp_is_activity_component()
440
* @uses bp_is_current_action()
@@ -445,20 +300,21 @@ add_action( 'bp_actions', 'bp_activity_action_post_comment' );
445
* @uses bp_core_redirect()
446
* @uses wp_get_referer()
447
*
448
- * @return bool False on failure.
449
*/
450
function bp_activity_action_mark_favorite() {
451
452
- if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'favorite' ) )
453
return false;
454
455
- // Check the nonce.
456
check_admin_referer( 'mark_favorite' );
457
458
if ( bp_activity_add_user_favorite( bp_action_variable( 0 ) ) )
459
bp_core_add_message( __( 'Activity marked as favorite.', 'buddypress' ) );
460
else
461
- bp_core_add_message( __( 'There was an error marking that activity as a favorite. Please try again.', 'buddypress' ), 'error' );
462
463
bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) );
464
}
@@ -469,6 +325,7 @@ add_action( 'bp_actions', 'bp_activity_action_mark_favorite' );
469
*
470
* @since 1.2.0
471
*
472
* @uses is_user_logged_in()
473
* @uses bp_is_activity_component()
474
* @uses bp_is_current_action()
@@ -479,92 +336,88 @@ add_action( 'bp_actions', 'bp_activity_action_mark_favorite' );
479
* @uses bp_core_redirect()
480
* @uses wp_get_referer()
481
*
482
- * @return bool False on failure.
483
*/
484
function bp_activity_action_remove_favorite() {
485
486
- if ( ! is_user_logged_in() || ! bp_is_activity_component() || ! bp_is_current_action( 'unfavorite' ) )
487
return false;
488
489
- // Check the nonce.
490
check_admin_referer( 'unmark_favorite' );
491
492
if ( bp_activity_remove_user_favorite( bp_action_variable( 0 ) ) )
493
bp_core_add_message( __( 'Activity removed as favorite.', 'buddypress' ) );
494
else
495
- bp_core_add_message( __( 'There was an error removing that activity as a favorite. Please try again.', 'buddypress' ), 'error' );
496
497
bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) );
498
}
499
add_action( 'bp_actions', 'bp_activity_action_remove_favorite' );
500
501
/**
502
- * Load the sitewide activity feed.
503
*
504
* @since 1.0.0
505
*
506
* @uses bp_is_activity_component()
507
* @uses bp_is_current_action()
508
* @uses bp_is_user()
509
* @uses status_header()
510
*
511
- * @return bool False on failure.
512
*/
513
function bp_activity_action_sitewide_feed() {
514
- $bp = buddypress();
515
516
- if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) )
517
return false;
518
519
- // Setup the feed.
520
- buddypress()->activity->feed = new BP_Activity_Feed( array(
521
- 'id' => 'sitewide',
522
-
523
- /* translators: Sitewide activity RSS title - "[Site Name] | Site Wide Activity" */
524
- 'title' => sprintf( __( '%s | Site-Wide Activity', 'buddypress' ), bp_get_site_name() ),
525
526
- 'link' => bp_get_activity_directory_permalink(),
527
- 'description' => __( 'Activity feed for the entire site.', 'buddypress' ),
528
- 'activity_args' => 'display_comments=threaded'
529
- ) );
530
}
531
add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
532
533
/**
534
- * Load a user's personal activity feed.
535
*
536
* @since 1.0.0
537
*
538
* @uses bp_is_user_activity()
539
* @uses bp_is_current_action()
540
* @uses status_header()
541
*
542
- * @return bool False on failure.
543
*/
544
function bp_activity_action_personal_feed() {
545
- if ( ! bp_is_user_activity() || ! bp_is_current_action( 'feed' ) ) {
546
- return false;
547
- }
548
549
- // Setup the feed.
550
- buddypress()->activity->feed = new BP_Activity_Feed( array(
551
- 'id' => 'personal',
552
553
- /* translators: Personal activity RSS title - "[Site Name] | [User Display Name] | Activity" */
554
- 'title' => sprintf( __( '%1$s | %2$s | Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
555
556
- 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() ),
557
- 'description' => sprintf( __( 'Activity feed for %s.', 'buddypress' ), bp_get_displayed_user_fullname() ),
558
- 'activity_args' => 'user_id=' . bp_displayed_user_id()
559
- ) );
560
}
561
add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
562
563
/**
564
- * Load a user's friends' activity feed.
565
*
566
* @since 1.0.0
567
*
568
* @uses bp_is_active()
569
* @uses bp_is_user_activity()
570
* @uses bp_is_current_action()
@@ -572,32 +425,29 @@ add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
572
* @uses bp_is_action_variable()
573
* @uses status_header()
574
*
575
- * @return bool False on failure.
576
*/
577
function bp_activity_action_friends_feed() {
578
- if ( ! bp_is_active( 'friends' ) || ! bp_is_user_activity() || ! bp_is_current_action( bp_get_friends_slug() ) || ! bp_is_action_variable( 'feed', 0 ) ) {
579
- return false;
580
- }
581
582
- // Setup the feed.
583
- buddypress()->activity->feed = new BP_Activity_Feed( array(
584
- 'id' => 'friends',
585
586
- /* translators: Friends activity RSS title - "[Site Name] | [User Display Name] | Friends Activity" */
587
- 'title' => sprintf( __( '%1$s | %2$s | Friends Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
588
589
- 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() ),
590
- 'description' => sprintf( __( "Activity feed for %s's friends.", 'buddypress' ), bp_get_displayed_user_fullname() ),
591
- 'activity_args' => 'scope=friends'
592
- ) );
593
}
594
add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
595
596
/**
597
- * Load the activity feed for a user's groups.
598
*
599
* @since 1.2.0
600
*
601
* @uses bp_is_active()
602
* @uses bp_is_user_activity()
603
* @uses bp_is_current_action()
@@ -605,32 +455,19 @@ add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
605
* @uses bp_is_action_variable()
606
* @uses status_header()
607
*
608
- * @return bool False on failure.
609
*/
610
function bp_activity_action_my_groups_feed() {
611
- if ( ! bp_is_active( 'groups' ) || ! bp_is_user_activity() || ! bp_is_current_action( bp_get_groups_slug() ) || ! bp_is_action_variable( 'feed', 0 ) ) {
612
return false;
613
- }
614
615
- // Get displayed user's group IDs.
616
- $groups = groups_get_user_groups();
617
- $group_ids = implode( ',', $groups['groups'] );
618
-
619
- // Setup the feed.
620
- buddypress()->activity->feed = new BP_Activity_Feed( array(
621
- 'id' => 'mygroups',
622
-
623
- /* translators: Member groups activity RSS title - "[Site Name] | [User Display Name] | Groups Activity" */
624
- 'title' => sprintf( __( '%1$s | %2$s | Group Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
625
-
626
- 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() ),
627
- 'description' => sprintf( __( "Public group activity feed of which %s is a member.", 'buddypress' ), bp_get_displayed_user_fullname() ),
628
- 'activity_args' => array(
629
- 'object' => buddypress()->groups->id,
630
- 'primary_id' => $group_ids,
631
- 'display_comments' => 'threaded'
632
- )
633
- ) );
634
}
635
add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
636
@@ -639,35 +476,26 @@ add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
639
*
640
* @since 1.2.0
641
*
642
* @uses bp_is_user_activity()
643
* @uses bp_is_current_action()
644
* @uses bp_is_action_variable()
645
* @uses status_header()
646
*
647
- * @return bool False on failure.
648
*/
649
function bp_activity_action_mentions_feed() {
650
- if ( ! bp_activity_do_mentions() ) {
651
- return false;
652
- }
653
654
- if ( !bp_is_user_activity() || ! bp_is_current_action( 'mentions' ) || ! bp_is_action_variable( 'feed', 0 ) ) {
655
return false;
656
- }
657
658
- // Setup the feed.
659
- buddypress()->activity->feed = new BP_Activity_Feed( array(
660
- 'id' => 'mentions',
661
662
- /* translators: User mentions activity RSS title - "[Site Name] | [User Display Name] | Mentions" */
663
- 'title' => sprintf( __( '%1$s | %2$s | Mentions', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
664
-
665
- 'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/',
666
- 'description' => sprintf( __( "Activity feed mentioning %s.", 'buddypress' ), bp_get_displayed_user_fullname() ),
667
- 'activity_args' => array(
668
- 'search_terms' => '@' . bp_core_get_username( bp_displayed_user_id() )
669
- )
670
- ) );
671
}
672
add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
673
@@ -676,316 +504,27 @@ add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
676
*
677
* @since 1.2.0
678
*
679
* @uses bp_is_user_activity()
680
* @uses bp_is_current_action()
681
* @uses bp_is_action_variable()
682
* @uses status_header()
683
*
684
- * @return bool False on failure.
685
*/
686
function bp_activity_action_favorites_feed() {
687
- if ( ! bp_is_user_activity() || ! bp_is_current_action( 'favorites' ) || ! bp_is_action_variable( 'feed', 0 ) ) {
688
- return false;
689
- }
690
-
691
- // Get displayed user's favorite activity IDs.
692
- $favs = bp_activity_get_user_favorites( bp_displayed_user_id() );
693
- $fav_ids = implode( ',', (array) $favs );
694
695
- // Setup the feed.
696
- buddypress()->activity->feed = new BP_Activity_Feed( array(
697
- 'id' => 'favorites',
698
699
- /* translators: User activity favorites RSS title - "[Site Name] | [User Display Name] | Favorites" */
700
- 'title' => sprintf( __( '%1$s | %2$s | Favorites', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
701
702
- 'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/',
703
- 'description' => sprintf( __( "Activity feed of %s's favorites.", 'buddypress' ), bp_get_displayed_user_fullname() ),
704
- 'activity_args' => 'include=' . $fav_ids
705
- ) );
706
}
707
add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
708
709
- /**
710
- * Loads Akismet filtering for activity.
711
- *
712
- * @since 1.6.0
713
- * @since 2.3.0 We only support Akismet 3+.
714
- */
715
- function bp_activity_setup_akismet() {
716
- $bp = buddypress();
717
-
718
- // Bail if Akismet is not active.
719
- if ( ! defined( 'AKISMET_VERSION' ) ) {
720
- return;
721
- }
722
-
723
- // Bail if older version of Akismet.
724
- if ( ! class_exists( 'Akismet' ) ) {
725
- return;
726
- }
727
-
728
- // Bail if no Akismet key is set.
729
- if ( ! bp_get_option( 'wordpress_api_key' ) && ! defined( 'WPCOM_API_KEY' ) ) {
730
- return;
731
- }
732
-
733
- /**
734
- * Filters if BuddyPress Activity Akismet support has been disabled by another plugin.
735
- *
736
- * @since 1.6.0
737
- *
738
- * @param bool $value Return value of bp_is_akismet_active boolean function.
739
- */
740
- if ( ! apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) {
741
- return;
742
- }
743
-
744
- // Instantiate Akismet for BuddyPress.
745
- $bp->activity->akismet = new BP_Akismet();
746
- }
747
-
748
- /**
749
- * AJAX endpoint for Suggestions API lookups.
750
- *
751
- * @since 2.1.0
752
- */
753
- function bp_ajax_get_suggestions() {
754
- if ( ! bp_is_user_active() || empty( $_GET['term'] ) || empty( $_GET['type'] ) ) {
755
- wp_send_json_error( 'missing_parameter' );
756
- exit;
757
- }
758
-
759
- $args = array(
760
- 'term' => sanitize_text_field( $_GET['term'] ),
761
- 'type' => sanitize_text_field( $_GET['type'] ),
762
- );
763
-
764
- // Support per-Group suggestions.
765
- if ( ! empty( $_GET['group-id'] ) ) {
766
- $args['group_id'] = absint( $_GET['group-id'] );
767
- }
768
-
769
- $results = bp_core_get_suggestions( $args );
770
-
771
- if ( is_wp_error( $results ) ) {
772
- wp_send_json_error( $results->get_error_message() );
773
- exit;
774
- }
775
-
776
- wp_send_json_success( $results );
777
- }
778
- add_action( 'wp_ajax_bp_get_suggestions', 'bp_ajax_get_suggestions' );
779
-
780
- /**
781
- * Detect a change in post type status, and initiate an activity update if necessary.
782
- *
783
- * @since 2.2.0
784
- *
785
- * @todo Support untrashing better.
786
- *
787
- * @param string $new_status New status for the post.
788
- * @param string $old_status Old status for the post.
789
- * @param object $post Post data.
790
- */
791
- function bp_activity_catch_transition_post_type_status( $new_status, $old_status, $post ) {
792
- if ( ! post_type_supports( $post->post_type, 'buddypress-activity' ) ) {
793
- return;
794
- }
795
-
796
- // This is an edit.
797
- if ( $new_status === $old_status ) {
798
- // An edit of an existing post should update the existing activity item.
799
- if ( $new_status == 'publish' ) {
800
- $edit = bp_activity_post_type_update( $post );
801
-
802
- // Post was never recorded into activity stream, so record it now!
803
- if ( null === $edit ) {
804
- bp_activity_post_type_publish( $post->ID, $post );
805
- }
806
-
807
- // Allow plugins to eventually deal with other post statuses.
808
- } else {
809
- /**
810
- * Fires when editing the post and the new status is not 'publish'.
811
- *
812
- * This is a variable filter that is dependent on the post type
813
- * being untrashed.
814
- *
815
- * @since 2.5.0
816
- *
817
- * @param WP_Post $post Post data.
818
- * @param string $new_status New status for the post.
819
- * @param string $old_status Old status for the post.
820
- */
821
- do_action( 'bp_activity_post_type_edit_' . $post->post_type, $post, $new_status, $old_status );
822
- }
823
-
824
- return;
825
- }
826
-
827
- // Publishing a previously unpublished post.
828
- if ( 'publish' === $new_status ) {
829
- // Untrashing the post type - nothing here yet.
830
- if ( 'trash' == $old_status ) {
831
-
832
- /**
833
- * Fires if untrashing post in a post type.
834
- *
835
- * This is a variable filter that is dependent on the post type
836
- * being untrashed.
837
- *
838
- * @since 2.2.0
839
- *
840
- * @param WP_Post $post Post data.
841
- */
842
- do_action( 'bp_activity_post_type_untrash_' . $post->post_type, $post );
843
- } else {
844
- // Record the post.
845
- bp_activity_post_type_publish( $post->ID, $post );
846
- }
847
-
848
- // Unpublishing a previously published post.
849
- } elseif ( 'publish' === $old_status ) {
850
- // Some form of pending status - only remove the activity entry.
851
- bp_activity_post_type_unpublish( $post->ID, $post );
852
-
853
- // For any other cases, allow plugins to eventually deal with it.
854
- } else {
855
- /**
856
- * Fires when the old and the new post status are not 'publish'.
857
- *
858
- * This is a variable filter that is dependent on the post type
859
- * being untrashed.
860
- *
861
- * @since 2.5.0
862
- *
863
- * @param WP_Post $post Post data.
864
- * @param string $new_status New status for the post.
865
- * @param string $old_status Old status for the post.
866
- */
867
- do_action( 'bp_activity_post_type_transition_status_' . $post->post_type, $post, $new_status, $old_status );
868
- }
869
- }
870
- add_action( 'transition_post_status', 'bp_activity_catch_transition_post_type_status', 10, 3 );
871
-
872
- /**
873
- * When a post type comment status transition occurs, update the relevant activity's status.
874
- *
875
- * @since 2.5.0
876
- *
877
- * @param string $new_status New comment status.
878
- * @param string $old_status Previous comment status.
879
- * @param WP_Comment $comment Comment data.
880
- */
881
- function bp_activity_transition_post_type_comment_status( $new_status, $old_status, $comment ) {
882
- $post_type = get_post_type( $comment->comment_post_ID );
883
- if ( ! $post_type ) {
884
- return;
885
- }
886
-
887
- // Get the post type tracking args.
888
- $activity_post_object = bp_activity_get_post_type_tracking_args( $post_type );
889
-
890
- // Bail if the activity type does not exist
891
- if ( empty( $activity_post_object->comments_tracking->action_id ) ) {
892
- return false;
893
-
894
- // Set the $activity_comment_object
895
- } else {
896
- $activity_comment_object = $activity_post_object->comments_tracking;
897
- }
898
-
899
- // Init an empty activity ID
900
- $activity_id = 0;
901
-
902
- /**
903
- * Activity currently doesn't have any concept of a trash, or an unapproved/approved state.
904
- *
905
- * If a blog comment transitions to a "delete" or "hold" status, delete the activity item.
906
- * If a blog comment transitions to trashed, or spammed, mark the activity as spam.
907
- * If a blog comment transitions to approved (and the activity exists), mark the activity as ham.
908
- * If a blog comment transitions to unapproved (and the activity exists), mark the activity as spam.
909
- * Otherwise, record the comment into the activity stream.
910
- */
911
-
912
- // This clause handles delete/hold.
913
- if ( in_array( $new_status, array( 'delete', 'hold' ) ) ) {
914
- return bp_activity_post_type_remove_comment( $comment->comment_ID, $activity_post_object );
915
-
916
- // These clauses handle trash, spam, and un-spams.
917
- } elseif ( in_array( $new_status, array( 'trash', 'spam', 'unapproved' ) ) ) {
918
- $action = 'spam_activity';
919
- } elseif ( 'approved' == $new_status ) {
920
- $action = 'ham_activity';
921
- }
922
-
923
- // Get the activity
924
- if ( bp_disable_blogforum_comments() ) {
925
- $activity_id = bp_activity_get_activity_id( array(
926
- 'component' => $activity_comment_object->component_id,
927
- 'item_id' => get_current_blog_id(),
928
- 'secondary_item_id' => $comment->comment_ID,
929
- 'type' => $activity_comment_object->action_id,
930
- ) );
931
- } else {
932
- $activity_id = get_comment_meta( $comment->comment_ID, 'bp_activity_comment_id', true );
933
- }
934
-
935
- /**
936
- * Leave a chance to plugins to manage activity comments differently.
937
- *
938
- * @since 2.5.0
939
- *
940
- * @param bool $value True to override BuddyPress management.
941
- * @param string $post_type The post type name.
942
- * @param int $activity_id The post type activity (0 if not found).
943
- * @param string $new_status The new status of the post type comment.
944
- * @param string $old_status The old status of the post type comment.
945
- * @param WP_Comment $comment Comment data.
946
- */
947
- if ( true === apply_filters( 'bp_activity_pre_transition_post_type_comment_status', false, $post_type, $activity_id, $new_status, $old_status, $comment ) ) {
948
- return false;
949
- }
950
-
951
- // Check activity item exists
952
- if ( empty( $activity_id ) ) {
953
- // If no activity exists, but the comment has been approved, record it into the activity table.
954
- if ( 'approved' == $new_status ) {
955
- return bp_activity_post_type_comment( $comment->comment_ID, true, $activity_post_object );
956
- }
957
-
958
- return;
959
- }
960
-
961
- // Create an activity object
962
- $activity = new BP_Activity_Activity( $activity_id );
963
- if ( empty( $activity->component ) ) {
964
- return;
965
- }
966
-
967
- // Spam/ham the activity if it's not already in that state
968
- if ( 'spam_activity' === $action && ! $activity->is_spam ) {
969
- bp_activity_mark_as_spam( $activity );
970
- } elseif ( 'ham_activity' == $action) {
971
- bp_activity_mark_as_ham( $activity );
972
- }
973
-
974
- // Add "new_post_type_comment" to the whitelisted activity types, so that the activity's Akismet history is generated
975
- $post_type_comment_action = $activity_comment_object->action_id;
976
- $comment_akismet_history = create_function( '$t', '$t[] = $post_type_comment_action; return $t;' );
977
- add_filter( 'bp_akismet_get_activity_types', $comment_akismet_history );
978
-
979
- // Make sure the activity change won't edit the comment if sync is on
980
- remove_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comment', 20 );
981
-
982
- // Save the updated activity
983
- $activity->save();
984
-
985
- // Restore the action
986
- add_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comment', 20 );
987
-
988
- // Remove the "new_blog_comment" activity type whitelist so we don't break anything
989
- remove_filter( 'bp_akismet_get_activity_types', $comment_akismet_history );
990
- }
991
- add_action( 'transition_comment_status', 'bp_activity_transition_post_type_comment_status', 10, 3 );
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
7
*
8
* @package BuddyPress
9
* @subpackage ActivityActions
10
*/
11
12
+ // Exit if accessed directly
13
+ if ( !defined( 'ABSPATH' ) ) exit;
14
15
/**
16
+ * Allow core components and dependent plugins to register activity actions
17
*
18
* @since 1.2.0
19
*
20
* @uses do_action() To call 'bp_register_activity_actions' hook.
21
*/
22
function bp_register_activity_actions() {
23
do_action( 'bp_register_activity_actions' );
24
}
25
add_action( 'bp_init', 'bp_register_activity_actions', 8 );
26
27
/**
28
+ * Allow core components and dependent plugins to register activity actions
29
*
30
* @since 1.2.0
31
*
32
+ * @global object $bp BuddyPress global settings
33
* @uses bp_is_activity_component()
34
* @uses bp_is_current_action()
35
* @uses bp_action_variable()
38
* @uses bp_core_get_user_domain()
39
* @uses groups_get_group()
40
* @uses bp_get_group_permalink()
41
+ * @uses apply_filters_ref_array() To call the 'bp_activity_permalink_redirect_url' hook
42
* @uses bp_core_redirect()
43
* @uses bp_get_root_domain()
44
*
45
+ * @return bool False on failure
46
*/
47
function bp_activity_action_permalink_router() {
48
+ global $bp;
49
50
+ // Not viewing activity
51
+ if ( !bp_is_activity_component() || !bp_is_current_action( 'p' ) )
52
return false;
53
54
+ // No activity to display
55
+ if ( !bp_action_variable( 0 ) || !is_numeric( bp_action_variable( 0 ) ) )
56
return false;
57
58
+ // Get the activity details
59
$activity = bp_activity_get_specific( array( 'activity_ids' => bp_action_variable( 0 ), 'show_hidden' => true ) );
60
61
// 404 if activity does not exist
62
if ( empty( $activity['activities'][0] ) ) {
63
bp_do_404();
64
return;
65
+
66
} else {
67
$activity = $activity['activities'][0];
68
}
69
70
+ // Do not redirect at default
71
$redirect = false;
72
73
+ // Redirect based on the type of activity
74
+ if ( bp_is_active( 'groups' ) && $activity->component == $bp->groups->id ) {
75
76
+ // Activity is a user update
77
+ if ( !empty( $activity->user_id ) ) {
78
$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
79
80
+ // Activity is something else
81
} else {
82
83
+ // Set redirect to group activity stream
84
if ( $group = groups_get_group( array( 'group_id' => $activity->item_id ) ) ) {
85
$redirect = bp_get_group_permalink( $group ) . bp_get_activity_slug() . '/' . $activity->id . '/';
86
}
87
}
88
89
+ // Set redirect to users' activity stream
90
+ } else {
91
+ $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id;
92
}
93
94
+ // Allow redirect to be filtered
95
+ if ( !$redirect = apply_filters_ref_array( 'bp_activity_permalink_redirect_url', array( $redirect, &$activity ) ) )
96
bp_core_redirect( bp_get_root_domain() );
97
98
+ // Redirect to the actual activity permalink page
99
bp_core_redirect( $redirect );
100
}
101
add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
105
*
106
* @since 1.1.0
107
*
108
+ * @param int $activity_id Activity id to be deleted. Defaults to 0.
109
+ *
110
+ * @global object $bp BuddyPress global settings
111
* @uses bp_is_activity_component()
112
* @uses bp_is_current_action()
113
* @uses bp_action_variable()
119
* @uses do_action() Calls 'bp_activity_action_delete_activity' hook to allow actions to be taken after the activity is deleted.
120
* @uses bp_core_redirect()
121
*
122
+ * @return bool False on failure
123
*/
124
function bp_activity_action_delete_activity( $activity_id = 0 ) {
125
+ global $bp;
126
127
+ // Not viewing activity or action is not delete
128
if ( !bp_is_activity_component() || !bp_is_current_action( 'delete' ) )
129
return false;
130
131
if ( empty( $activity_id ) && bp_action_variable( 0 ) )
132
$activity_id = (int) bp_action_variable( 0 );
133
134
+ // Not viewing a specific activity item
135
if ( empty( $activity_id ) )
136
return false;
137
138
+ // Check the nonce
139
check_admin_referer( 'bp_activity_delete_link' );
140
141
+ // Load up the activity item
142
$activity = new BP_Activity_Activity( $activity_id );
143
144
+ // Check access
145
+ if ( empty( $activity->user_id ) || !bp_activity_user_can_delete( $activity ) )
146
return false;
147
148
+ // Call the action before the delete so plugins can still fetch information about it
149
do_action( 'bp_activity_before_action_delete_activity', $activity_id, $activity->user_id );
150
151
+ // Delete the activity item and provide user feedback
152
if ( bp_activity_delete( array( 'id' => $activity_id, 'user_id' => $activity->user_id ) ) )
153
bp_core_add_message( __( 'Activity deleted successfully', 'buddypress' ) );
154
else
155
bp_core_add_message( __( 'There was an error when deleting that activity', 'buddypress' ), 'error' );
156
157
do_action( 'bp_activity_action_delete_activity', $activity_id, $activity->user_id );
158
159
+ // Check for the redirect query arg, otherwise let WP handle things
160
+ if ( !empty( $_GET['redirect_to'] ) )
161
bp_core_redirect( esc_url( $_GET['redirect_to'] ) );
162
else
163
bp_core_redirect( wp_get_referer() );
164
}
165
add_action( 'bp_actions', 'bp_activity_action_delete_activity' );
166
167
/**
168
* Post user/group activity update.
169
*
170
* @since 1.2.0
171
*
172
+ * @global object $bp BuddyPress global settings
173
* @uses is_user_logged_in()
174
* @uses bp_is_activity_component()
175
* @uses bp_is_current_action()
184
* @uses bp_core_redirect()
185
* @uses apply_filters() To call 'bp_activity_custom_update' hook.
186
*
187
+ * @return bool False on failure
188
*/
189
function bp_activity_action_post_update() {
190
+ global $bp;
191
192
+ // Do not proceed if user is not logged in, not viewing activity, or not posting
193
if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'post' ) )
194
return false;
195
196
+ // Check the nonce
197
check_admin_referer( 'post_update', '_wpnonce_post_update' );
198
199
+ // Get activity info
200
+ $content = apply_filters( 'bp_activity_post_update_content', $_POST['whats-new'] );
201
+ $object = apply_filters( 'bp_activity_post_update_object', $_POST['whats-new-post-object'] );
202
+ $item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in'] );
203
204
+ // No activity content so provide feedback and redirect
205
if ( empty( $content ) ) {
206
bp_core_add_message( __( 'Please enter some content to post.', 'buddypress' ), 'error' );
207
bp_core_redirect( wp_get_referer() );
208
}
209
210
+ // No existing item_id
211
if ( empty( $item_id ) ) {
212
$activity_id = bp_activity_post_update( array( 'content' => $content ) );
213
214
+ // Post to groups object
215
+ } else if ( 'groups' == $object && bp_is_active( 'groups' ) ) {
216
+ if ( (int)$item_id ) {
217
$activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) );
218
}
219
220
+ // Special circumstance so let filters handle it
221
} else {
222
$activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );
223
}
224
225
+ // Provide user feedback
226
if ( !empty( $activity_id ) )
227
bp_core_add_message( __( 'Update Posted!', 'buddypress' ) );
228
else
229
+ bp_core_add_message( __( 'There was an error when posting your update, please try again.', 'buddypress' ), 'error' );
230
231
+ // Redirect
232
bp_core_redirect( wp_get_referer() );
233
}
234
add_action( 'bp_actions', 'bp_activity_action_post_update' );
238
*
239
* @since 1.2.0
240
*
241
+