BuddyPress - Version 2.7.1

Version Description

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

Download this release

Release Info

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

Code changes from version 2.9.0 to 2.7.1

Files changed (476) hide show
  1. bp-activity/admin/css/admin-rtl.css +5 -23
  2. bp-activity/admin/css/admin-rtl.min.css +1 -1
  3. bp-activity/admin/css/admin.css +5 -23
  4. bp-activity/admin/css/admin.min.css +1 -1
  5. bp-activity/admin/js/admin.min.js +1 -1
  6. bp-activity/bp-activity-actions.php +1 -5
  7. bp-activity/bp-activity-admin.php +8 -5
  8. bp-activity/bp-activity-akismet.php +4 -0
  9. bp-activity/bp-activity-classes.php +20 -0
  10. bp-activity/bp-activity-embeds.php +1 -1
  11. bp-activity/bp-activity-filters.php +14 -11
  12. bp-activity/bp-activity-functions.php +28 -114
  13. bp-activity/bp-activity-loader.php +4 -0
  14. bp-activity/bp-activity-notifications.php +1 -1
  15. bp-activity/bp-activity-screens.php +4 -0
  16. bp-activity/bp-activity-template.php +55 -64
  17. bp-activity/classes/class-bp-activity-activity.php +120 -72
  18. bp-activity/classes/class-bp-activity-component.php +4 -0
  19. bp-activity/classes/class-bp-activity-list-table.php +12 -7
  20. bp-activity/classes/class-bp-activity-template.php +2 -1
  21. bp-activity/css/mentions-rtl.css +10 -24
  22. bp-activity/css/mentions-rtl.min.css +1 -1
  23. bp-activity/css/mentions.css +10 -25
  24. bp-activity/css/mentions.min.css +1 -1
  25. bp-activity/js/mentions.min.js +1 -1
  26. bp-blogs/bp-blogs-activity.php +8 -17
  27. bp-blogs/bp-blogs-classes.php +13 -0
  28. bp-blogs/bp-blogs-functions.php +4 -62
  29. bp-blogs/bp-blogs-loader.php +4 -0
  30. bp-blogs/bp-blogs-screens.php +4 -0
  31. bp-blogs/bp-blogs-template.php +12 -14
  32. bp-blogs/bp-blogs-widgets.php +5 -1
  33. bp-blogs/classes/class-bp-blogs-blog.php +0 -17
  34. bp-blogs/classes/class-bp-blogs-component.php +4 -0
  35. bp-core/admin/bp-core-admin-classes.php +13 -0
  36. bp-core/admin/bp-core-admin-functions.php +186 -15
  37. bp-core/admin/bp-core-admin-settings.php +1 -33
  38. bp-core/admin/bp-core-admin-slugs.php +1 -0
  39. bp-core/admin/bp-core-admin-tools.php +2 -2
  40. bp-core/admin/css/common-rtl.css +153 -204
  41. bp-core/admin/css/common-rtl.min.css +1 -1
  42. bp-core/admin/css/common.css +153 -204
  43. bp-core/admin/css/common.min.css +1 -1
  44. bp-core/admin/css/customizer-controls-rtl.css +3 -3
  45. bp-core/admin/css/customizer-controls-rtl.min.css +1 -1
  46. bp-core/admin/css/customizer-controls.css +3 -3
  47. bp-core/admin/css/customizer-controls.min.css +1 -1
  48. bp-core/admin/images/list-unsubscribe.png +0 -0
  49. bp-core/admin/images/pending-accounts.png +0 -0
  50. bp-core/admin/images/twenty-seventeen.png +0 -0
  51. bp-core/admin/js/customizer-controls.min.js +1 -1
  52. bp-core/admin/js/customizer-receiver-emails.min.js +1 -1
  53. bp-core/admin/js/dismissible-admin-notices.min.js +1 -1
  54. bp-core/bp-core-actions.php +0 -1
  55. bp-core/bp-core-admin.php +4 -0
  56. bp-core/bp-core-adminbar.php +6 -5
  57. bp-core/bp-core-attachments.php +5 -18
  58. bp-core/bp-core-avatars.php +112 -56
  59. bp-core/bp-core-buddybar.php +22 -18
  60. bp-core/bp-core-cache.php +6 -9
  61. bp-core/bp-core-catchuri.php +7 -42
  62. bp-core/bp-core-classes.php +41 -0
  63. bp-core/bp-core-cssjs.php +2 -2
  64. bp-core/bp-core-customizer-email.php +7 -0
  65. bp-core/bp-core-dependency.php +3 -1
  66. bp-core/bp-core-filters.php +5 -20
  67. bp-core/bp-core-functions.php +37 -108
  68. bp-core/bp-core-loader.php +5 -0
  69. bp-core/bp-core-moderation.php +2 -2
  70. bp-core/bp-core-options.php +11 -4
  71. bp-core/bp-core-template-loader.php +5 -10
  72. bp-core/bp-core-template.php +4 -21
  73. bp-core/bp-core-theme-compatibility.php +6 -0
  74. bp-core/bp-core-update.php +1 -1
  75. bp-core/bp-core-widgets.php +5 -1
  76. bp-core/bp-core-wpabstraction.php +5 -5
  77. bp-core/classes/class-bp-admin.php +147 -115
  78. bp-core/classes/class-bp-attachment-avatar.php +2 -14
  79. bp-core/classes/class-bp-attachment-cover-image.php +1 -1
  80. bp-core/classes/class-bp-attachment.php +25 -33
  81. bp-core/classes/class-bp-button.php +0 -7
  82. bp-core/classes/class-bp-core-bp-nav-backcompat.php +1 -1
  83. bp-core/classes/class-bp-core-login-widget.php +1 -1
  84. bp-core/classes/class-bp-core-nav-item.php +19 -0
  85. bp-core/classes/class-bp-core-nav.php +1 -1
  86. bp-core/classes/class-bp-core-oembed-extension.php +0 -2
  87. bp-core/classes/class-bp-core-sort-by-key-callback.php +83 -0
  88. bp-core/classes/class-bp-core-user.php +14 -4
  89. bp-core/classes/class-bp-core.php +4 -2
  90. bp-core/classes/class-bp-media-extractor.php +1 -1
  91. bp-core/classes/class-bp-phpmailer.php +2 -13
  92. bp-core/classes/class-bp-user-query.php +1 -1
  93. bp-core/classes/class-bp-walker-nav-menu.php +3 -1
  94. bp-core/css/admin-bar-rtl.css +5 -7
  95. bp-core/css/admin-bar-rtl.min.css +1 -1
  96. bp-core/css/admin-bar.css +5 -7
  97. bp-core/css/admin-bar.min.css +1 -1
  98. bp-core/css/avatar-rtl.css +15 -22
  99. bp-core/css/avatar-rtl.min.css +1 -1
  100. bp-core/css/avatar.css +15 -22
  101. bp-core/css/avatar.min.css +1 -1
  102. bp-core/css/buddybar-rtl.css +5 -39
  103. bp-core/css/buddybar-rtl.min.css +1 -1
  104. bp-core/css/buddybar.css +5 -39
  105. bp-core/css/buddybar.min.css +1 -1
  106. bp-core/deprecated/1.2.php +1 -1
  107. bp-core/deprecated/1.5.php +1 -1
  108. bp-core/deprecated/1.7.php +1 -1
  109. bp-core/deprecated/1.9.php +16 -19
  110. bp-core/deprecated/2.1.php +4 -4
  111. bp-core/deprecated/2.5.php +3 -3
  112. bp-core/deprecated/2.8.php +0 -199
  113. bp-core/deprecated/2.9.php +0 -30
  114. bp-core/js/avatar.min.js +1 -1
  115. bp-core/js/bp-plupload.js +0 -5
  116. bp-core/js/bp-plupload.min.js +1 -1
  117. bp-core/js/cover-image.min.js +1 -1
  118. bp-core/js/jquery-query.min.js +1 -1
  119. bp-core/js/vendor/jquery-cookie.min.js +1 -1
  120. bp-core/js/vendor/jquery-scroll-to.min.js +1 -1
  121. bp-core/js/vendor/jquery.atwho.min.js +1 -1
  122. bp-core/js/vendor/jquery.caret.min.js +1 -1
  123. bp-core/js/vendor/livestamp.min.js +1 -1
  124. bp-core/js/vendor/moment-js/locale/af.min.js +1 -1
  125. bp-core/js/vendor/moment-js/locale/ar-ly.min.js +1 -1
  126. bp-core/js/vendor/moment-js/locale/ar-ma.min.js +1 -1
  127. bp-core/js/vendor/moment-js/locale/ar-sa.min.js +1 -1
  128. bp-core/js/vendor/moment-js/locale/ar-tn.min.js +1 -1
  129. bp-core/js/vendor/moment-js/locale/ar.min.js +1 -1
  130. bp-core/js/vendor/moment-js/locale/az.min.js +1 -1
  131. bp-core/js/vendor/moment-js/locale/be.min.js +1 -1
  132. bp-core/js/vendor/moment-js/locale/bg.min.js +1 -1
  133. bp-core/js/vendor/moment-js/locale/bn.min.js +1 -1
  134. bp-core/js/vendor/moment-js/locale/bo.min.js +1 -1
  135. bp-core/js/vendor/moment-js/locale/br.min.js +1 -1
  136. bp-core/js/vendor/moment-js/locale/bs.min.js +1 -1
  137. bp-core/js/vendor/moment-js/locale/ca.min.js +1 -1
  138. bp-core/js/vendor/moment-js/locale/cs.min.js +1 -1
  139. bp-core/js/vendor/moment-js/locale/cv.min.js +1 -1
  140. bp-core/js/vendor/moment-js/locale/cy.min.js +1 -1
  141. bp-core/js/vendor/moment-js/locale/da.min.js +1 -1
  142. bp-core/js/vendor/moment-js/locale/de-at.min.js +1 -1
  143. bp-core/js/vendor/moment-js/locale/de.min.js +1 -1
  144. bp-core/js/vendor/moment-js/locale/dv.min.js +1 -1
  145. bp-core/js/vendor/moment-js/locale/el.min.js +1 -1
  146. bp-core/js/vendor/moment-js/locale/en-au.min.js +1 -1
  147. bp-core/js/vendor/moment-js/locale/en-ca.min.js +1 -1
  148. bp-core/js/vendor/moment-js/locale/en-gb.min.js +1 -1
  149. bp-core/js/vendor/moment-js/locale/en-ie.min.js +1 -1
  150. bp-core/js/vendor/moment-js/locale/en-nz.min.js +1 -1
  151. bp-core/js/vendor/moment-js/locale/eo.min.js +1 -1
  152. bp-core/js/vendor/moment-js/locale/es-do.min.js +1 -1
  153. bp-core/js/vendor/moment-js/locale/es.min.js +1 -1
  154. bp-core/js/vendor/moment-js/locale/et.min.js +1 -1
  155. bp-core/js/vendor/moment-js/locale/eu.min.js +1 -1
  156. bp-core/js/vendor/moment-js/locale/fa.min.js +1 -1
  157. bp-core/js/vendor/moment-js/locale/fi.min.js +1 -1
  158. bp-core/js/vendor/moment-js/locale/fo.min.js +1 -1
  159. bp-core/js/vendor/moment-js/locale/fr-ca.min.js +1 -1
  160. bp-core/js/vendor/moment-js/locale/fr-ch.min.js +1 -1
  161. bp-core/js/vendor/moment-js/locale/fr.min.js +1 -1
  162. bp-core/js/vendor/moment-js/locale/fy.min.js +1 -1
  163. bp-core/js/vendor/moment-js/locale/gd.min.js +1 -1
  164. bp-core/js/vendor/moment-js/locale/gl.min.js +1 -1
  165. bp-core/js/vendor/moment-js/locale/he.min.js +1 -1
  166. bp-core/js/vendor/moment-js/locale/hi.min.js +1 -1
  167. bp-core/js/vendor/moment-js/locale/hr.min.js +1 -1
  168. bp-core/js/vendor/moment-js/locale/hu.min.js +1 -1
  169. bp-core/js/vendor/moment-js/locale/hy-am.min.js +1 -1
  170. bp-core/js/vendor/moment-js/locale/id.min.js +1 -1
  171. bp-core/js/vendor/moment-js/locale/is.min.js +1 -1
  172. bp-core/js/vendor/moment-js/locale/it.min.js +1 -1
  173. bp-core/js/vendor/moment-js/locale/ja.min.js +1 -1
  174. bp-core/js/vendor/moment-js/locale/jv.min.js +1 -1
  175. bp-core/js/vendor/moment-js/locale/ka.min.js +1 -1
  176. bp-core/js/vendor/moment-js/locale/kk.min.js +1 -1
  177. bp-core/js/vendor/moment-js/locale/km.min.js +1 -1
  178. bp-core/js/vendor/moment-js/locale/ko.min.js +1 -1
  179. bp-core/js/vendor/moment-js/locale/ky.min.js +1 -1
  180. bp-core/js/vendor/moment-js/locale/lb.min.js +1 -1
  181. bp-core/js/vendor/moment-js/locale/lo.min.js +1 -1
  182. bp-core/js/vendor/moment-js/locale/lt.min.js +1 -1
  183. bp-core/js/vendor/moment-js/locale/lv.min.js +1 -1
  184. bp-core/js/vendor/moment-js/locale/me.min.js +1 -1
  185. bp-core/js/vendor/moment-js/locale/mi.min.js +1 -1
  186. bp-core/js/vendor/moment-js/locale/mk.min.js +1 -1
  187. bp-core/js/vendor/moment-js/locale/ml.min.js +1 -1
  188. bp-core/js/vendor/moment-js/locale/mr.min.js +1 -1
  189. bp-core/js/vendor/moment-js/locale/ms-my.min.js +1 -1
  190. bp-core/js/vendor/moment-js/locale/ms.min.js +1 -1
  191. bp-core/js/vendor/moment-js/locale/my.min.js +1 -1
  192. bp-core/js/vendor/moment-js/locale/nb.min.js +1 -1
  193. bp-core/js/vendor/moment-js/locale/ne.min.js +1 -1
  194. bp-core/js/vendor/moment-js/locale/nl.min.js +1 -1
  195. bp-core/js/vendor/moment-js/locale/nn.min.js +1 -1
  196. bp-core/js/vendor/moment-js/locale/pa-in.min.js +1 -1
  197. bp-core/js/vendor/moment-js/locale/pl.min.js +1 -1
  198. bp-core/js/vendor/moment-js/locale/pt-br.min.js +1 -1
  199. bp-core/js/vendor/moment-js/locale/pt.min.js +1 -1
  200. bp-core/js/vendor/moment-js/locale/ro.min.js +1 -1
  201. bp-core/js/vendor/moment-js/locale/ru.min.js +1 -1
  202. bp-core/js/vendor/moment-js/locale/se.min.js +1 -1
  203. bp-core/js/vendor/moment-js/locale/si.min.js +1 -1
  204. bp-core/js/vendor/moment-js/locale/sk.min.js +1 -1
  205. bp-core/js/vendor/moment-js/locale/sl.min.js +1 -1
  206. bp-core/js/vendor/moment-js/locale/sq.min.js +1 -1
  207. bp-core/js/vendor/moment-js/locale/sr-cyrl.min.js +1 -1
  208. bp-core/js/vendor/moment-js/locale/sr.min.js +1 -1
  209. bp-core/js/vendor/moment-js/locale/ss.min.js +1 -1
  210. bp-core/js/vendor/moment-js/locale/sv.min.js +1 -1
  211. bp-core/js/vendor/moment-js/locale/sw.min.js +1 -1
  212. bp-core/js/vendor/moment-js/locale/ta.min.js +1 -1
  213. bp-core/js/vendor/moment-js/locale/te.min.js +1 -1
  214. bp-core/js/vendor/moment-js/locale/th.min.js +1 -1
  215. bp-core/js/vendor/moment-js/locale/tl-ph.min.js +1 -1
  216. bp-core/js/vendor/moment-js/locale/tlh.min.js +1 -1
  217. bp-core/js/vendor/moment-js/locale/tr.min.js +1 -1
  218. bp-core/js/vendor/moment-js/locale/tzl.min.js +1 -1
  219. bp-core/js/vendor/moment-js/locale/tzm-latn.min.js +1 -1
  220. bp-core/js/vendor/moment-js/locale/tzm.min.js +1 -1
  221. bp-core/js/vendor/moment-js/locale/uk.min.js +1 -1
  222. bp-core/js/vendor/moment-js/locale/uz.min.js +1 -1
  223. bp-core/js/vendor/moment-js/locale/vi.min.js +1 -1
  224. bp-core/js/vendor/moment-js/locale/x-pseudo.min.js +1 -1
  225. bp-core/js/vendor/moment-js/locale/zh-cn.min.js +1 -1
  226. bp-core/js/vendor/moment-js/locale/zh-hk.min.js +1 -1
  227. bp-core/js/vendor/moment-js/locale/zh-tw.min.js +1 -1
  228. bp-core/js/vendor/moment-js/moment.min.js +2 -1
  229. bp-core/js/webcam.min.js +1 -1
  230. bp-core/js/widget-members.min.js +1 -1
  231. bp-forums/bp-forums-bbpress-sa.php +3 -2
  232. bp-forums/bp-forums-template.php +1 -1
  233. bp-forums/deprecated/1.7.php +1 -1
  234. bp-friends/bp-friends-actions.php +1 -1
  235. bp-friends/bp-friends-activity.php +1 -1
  236. bp-friends/bp-friends-classes.php +13 -0
  237. bp-friends/bp-friends-functions.php +10 -37
  238. bp-friends/bp-friends-loader.php +4 -0
  239. bp-friends/bp-friends-template.php +5 -5
  240. bp-friends/bp-friends-widgets.php +6 -2
  241. bp-friends/classes/class-bp-core-friends-widget.php +2 -2
  242. bp-friends/classes/class-bp-friends-component.php +4 -0
  243. bp-friends/classes/class-bp-friends-friendship.php +11 -11
  244. bp-friends/js/widget-friends.min.js +1 -1
  245. bp-groups/admin/css/admin-rtl.css +5 -57
  246. bp-groups/admin/css/admin-rtl.min.css +1 -1
  247. bp-groups/admin/css/admin.css +5 -57
  248. bp-groups/admin/css/admin.min.css +1 -1
  249. bp-groups/admin/js/admin.min.js +1 -1
  250. bp-groups/bp-groups-actions.php +5 -28
  251. bp-groups/bp-groups-activity.php +6 -16
  252. bp-groups/bp-groups-admin.php +47 -59
  253. bp-groups/bp-groups-cache.php +0 -5
  254. bp-groups/bp-groups-classes.php +17 -0
  255. bp-groups/bp-groups-filters.php +1 -0
  256. bp-groups/bp-groups-forums.php +1 -1
  257. bp-groups/bp-groups-functions.php +39 -121
  258. bp-groups/bp-groups-loader.php +4 -0
  259. bp-groups/bp-groups-notifications.php +7 -32
  260. bp-groups/bp-groups-screens.php +23 -22
  261. bp-groups/bp-groups-template.php +58 -118
  262. bp-groups/bp-groups-widgets.php +9 -8
  263. bp-groups/classes/class-bp-group-extension.php +12 -23
  264. bp-groups/classes/class-bp-group-member-query.php +1 -1
  265. bp-groups/classes/class-bp-groups-component.php +22 -28
  266. bp-groups/classes/class-bp-groups-group-members-template.php +2 -1
  267. bp-groups/classes/class-bp-groups-group.php +140 -273
  268. bp-groups/classes/class-bp-groups-invite-template.php +3 -2
  269. bp-groups/classes/class-bp-groups-list-table.php +4 -5
  270. bp-groups/classes/class-bp-groups-member.php +9 -75
  271. bp-groups/classes/class-bp-groups-membership-requests-template.php +2 -1
  272. bp-groups/classes/class-bp-groups-template.php +2 -3
  273. bp-groups/classes/class-bp-groups-widget.php +6 -9
  274. bp-groups/js/widget-groups.min.js +1 -1
  275. bp-loader.php +767 -47
  276. bp-members/admin/css/admin-rtl.css +45 -75
  277. bp-members/admin/css/admin-rtl.min.css +1 -1
  278. bp-members/admin/css/admin.css +45 -75
  279. bp-members/admin/css/admin.min.css +1 -1
  280. bp-members/admin/js/admin.js +1 -3
  281. bp-members/admin/js/admin.min.js +1 -1
  282. bp-members/bp-members-admin.php +4 -0
  283. bp-members/bp-members-classes.php +13 -0
  284. bp-members/bp-members-functions.php +24 -49
  285. bp-members/bp-members-loader.php +4 -0
  286. bp-members/bp-members-screens.php +20 -6
  287. bp-members/bp-members-template.php +8 -6
  288. bp-members/bp-members-widgets.php +10 -4
  289. bp-members/classes/class-bp-core-members-widget.php +2 -2
  290. bp-members/classes/class-bp-core-recently-active-widget.php +1 -1
  291. bp-members/classes/class-bp-core-whos-online-widget.php +1 -1
  292. bp-members/classes/class-bp-members-admin.php +14 -83
  293. bp-members/classes/class-bp-members-component.php +4 -0
  294. bp-members/classes/class-bp-members-list-table.php +1 -1
  295. bp-members/classes/class-bp-members-ms-list-table.php +1 -1
  296. bp-members/classes/class-bp-signup.php +7 -42
  297. bp-messages/bp-messages-actions.php +8 -13
  298. bp-messages/bp-messages-cache.php +3 -4
  299. bp-messages/bp-messages-classes.php +15 -0
  300. bp-messages/bp-messages-filters.php +1 -1
  301. bp-messages/bp-messages-functions.php +19 -25
  302. bp-messages/bp-messages-loader.php +4 -0
  303. bp-messages/bp-messages-notifications.php +1 -9
  304. bp-messages/bp-messages-screens.php +2 -20
  305. bp-messages/bp-messages-star.php +4 -4
  306. bp-messages/bp-messages-template.php +41 -130
  307. bp-messages/bp-messages-widgets.php +5 -1
  308. bp-messages/classes/class-bp-messages-box-template.php +2 -1
  309. bp-messages/classes/class-bp-messages-component.php +21 -26
  310. bp-messages/classes/class-bp-messages-message.php +14 -34
  311. bp-messages/classes/class-bp-messages-notice.php +4 -30
  312. bp-messages/classes/class-bp-messages-sitewide-notices-widget.php +1 -1
  313. bp-messages/classes/class-bp-messages-thread.php +12 -50
  314. bp-messages/css/autocomplete/jquery.autocompletefb-rtl.css +47 -53
  315. bp-messages/css/autocomplete/jquery.autocompletefb-rtl.min.css +1 -1
  316. bp-messages/css/autocomplete/jquery.autocompletefb.css +47 -53
  317. bp-messages/css/autocomplete/jquery.autocompletefb.min.css +1 -1
  318. bp-messages/js/autocomplete/jquery.autocomplete.min.js +1 -1
  319. bp-messages/js/autocomplete/jquery.autocompletefb.min.js +1 -1
  320. bp-messages/js/autocomplete/jquery.bgiframe.js +36 -66
  321. bp-messages/js/autocomplete/jquery.bgiframe.min.js +1 -1
  322. bp-messages/js/autocomplete/jquery.dimensions.min.js +1 -1
  323. bp-messages/js/autocomplete/license.bgiframe.txt +5 -5
  324. bp-notifications/bp-notifications-classes.php +15 -0
  325. bp-notifications/bp-notifications-functions.php +11 -11
  326. bp-notifications/bp-notifications-loader.php +4 -0
  327. bp-notifications/bp-notifications-template.php +7 -3
  328. bp-notifications/classes/class-bp-notifications-component.php +4 -0
  329. bp-notifications/classes/class-bp-notifications-notification.php +6 -6
  330. bp-settings/bp-settings-actions.php +2 -6
  331. bp-settings/bp-settings-functions.php +0 -5
  332. bp-settings/bp-settings-loader.php +4 -0
  333. bp-settings/bp-settings-template.php +1 -1
  334. bp-templates/bp-legacy/buddypress-functions.php +84 -95
  335. bp-templates/bp-legacy/buddypress/activity/activity-loop.php +1 -1
  336. bp-templates/bp-legacy/buddypress/activity/comment.php +1 -1
  337. bp-templates/bp-legacy/buddypress/activity/entry.php +2 -2
  338. bp-templates/bp-legacy/buddypress/activity/index.php +1 -1
  339. bp-templates/bp-legacy/buddypress/activity/post-form.php +1 -1
  340. bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/index.php +1 -1
  341. bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php +1 -1
  342. bp-templates/bp-legacy/buddypress/assets/embeds/activity.php +1 -1
  343. bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php +1 -1
  344. bp-templates/bp-legacy/buddypress/blogs/create.php +1 -1
  345. bp-templates/bp-legacy/buddypress/forums/forums-loop.php +3 -3
  346. bp-templates/bp-legacy/buddypress/groups/create.php +1 -1
  347. bp-templates/bp-legacy/buddypress/groups/groups-loop.php +2 -2
  348. bp-templates/bp-legacy/buddypress/groups/single/activity.php +2 -2
  349. bp-templates/bp-legacy/buddypress/groups/single/admin.php +1 -1
  350. bp-templates/bp-legacy/buddypress/groups/single/admin/delete-group.php +1 -1
  351. bp-templates/bp-legacy/buddypress/groups/single/admin/edit-details.php +1 -1
  352. bp-templates/bp-legacy/buddypress/groups/single/admin/group-avatar.php +1 -1
  353. bp-templates/bp-legacy/buddypress/groups/single/admin/group-cover-image.php +1 -1
  354. bp-templates/bp-legacy/buddypress/groups/single/admin/group-settings.php +1 -1
  355. bp-templates/bp-legacy/buddypress/groups/single/admin/manage-members.php +2 -2
  356. bp-templates/bp-legacy/buddypress/groups/single/admin/membership-requests.php +1 -1
  357. bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php +1 -1
  358. bp-templates/bp-legacy/buddypress/groups/single/forum.php +2 -1
  359. bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php +1 -1
  360. bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php +2 -2
  361. bp-templates/bp-legacy/buddypress/groups/single/group-header.php +1 -1
  362. bp-templates/bp-legacy/buddypress/groups/single/members.php +1 -1
  363. bp-templates/bp-legacy/buddypress/groups/single/request-membership.php +1 -1
  364. bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php +1 -1
  365. bp-templates/bp-legacy/buddypress/groups/single/send-invites.php +1 -1
  366. bp-templates/bp-legacy/buddypress/members/members-loop.php +1 -1
  367. bp-templates/bp-legacy/buddypress/members/register.php +5 -6
  368. bp-templates/bp-legacy/buddypress/members/single/activity.php +1 -1
  369. bp-templates/bp-legacy/buddypress/members/single/forums.php +1 -1
  370. bp-templates/bp-legacy/buddypress/members/single/friends/requests.php +1 -1
  371. bp-templates/bp-legacy/buddypress/members/single/groups/invites.php +2 -2
  372. bp-templates/bp-legacy/buddypress/members/single/messages/message.php +1 -1
  373. bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php +6 -6
  374. bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php +2 -2
  375. bp-templates/bp-legacy/buddypress/members/single/messages/single.php +2 -2
  376. bp-templates/bp-legacy/buddypress/members/single/plugins.php +1 -1
  377. bp-templates/bp-legacy/buddypress/members/single/profile.php +1 -1
  378. bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php +2 -2
  379. bp-templates/bp-legacy/buddypress/members/single/profile/change-cover-image.php +1 -1
  380. bp-templates/bp-legacy/buddypress/members/single/profile/edit.php +5 -7
  381. bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php +1 -1
  382. bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php +1 -1
  383. bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php +1 -1
  384. bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php +1 -1
  385. bp-templates/bp-legacy/buddypress/members/single/settings/general.php +7 -5
  386. bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php +1 -1
  387. bp-templates/bp-legacy/css/buddypress-rtl.css +131 -579
  388. bp-templates/bp-legacy/css/buddypress-rtl.min.css +1 -1
  389. bp-templates/bp-legacy/css/buddypress.css +131 -579
  390. bp-templates/bp-legacy/css/buddypress.min.css +1 -1
  391. bp-templates/bp-legacy/css/embeds-activity-rtl.css +7 -8
  392. bp-templates/bp-legacy/css/embeds-activity-rtl.min.css +1 -1
  393. bp-templates/bp-legacy/css/embeds-activity.css +7 -8
  394. bp-templates/bp-legacy/css/embeds-activity.min.css +1 -1
  395. bp-templates/bp-legacy/css/twentyeleven-rtl.css +51 -47
  396. bp-templates/bp-legacy/css/twentyeleven-rtl.min.css +1 -1
  397. bp-templates/bp-legacy/css/twentyeleven.css +51 -47
  398. bp-templates/bp-legacy/css/twentyeleven.min.css +1 -1
  399. bp-templates/bp-legacy/css/twentyeleven.scss +78 -336
  400. bp-templates/bp-legacy/css/twentyfifteen-rtl.css +53 -49
  401. bp-templates/bp-legacy/css/twentyfifteen-rtl.min.css +1 -1
  402. bp-templates/bp-legacy/css/twentyfifteen.css +53 -49
  403. bp-templates/bp-legacy/css/twentyfifteen.min.css +1 -1
  404. bp-templates/bp-legacy/css/twentyfifteen.scss +76 -370
  405. bp-templates/bp-legacy/css/twentyfourteen-rtl.css +38 -32
  406. bp-templates/bp-legacy/css/twentyfourteen-rtl.min.css +1 -1
  407. bp-templates/bp-legacy/css/twentyfourteen.css +38 -32
  408. bp-templates/bp-legacy/css/twentyfourteen.min.css +1 -1
  409. bp-templates/bp-legacy/css/twentyfourteen.scss +45 -211
  410. bp-templates/bp-legacy/css/twentyseventeen-rtl.css +0 -2194
  411. bp-templates/bp-legacy/css/twentyseventeen-rtl.min.css +0 -1
  412. bp-templates/bp-legacy/css/twentyseventeen.css +0 -2194
  413. bp-templates/bp-legacy/css/twentyseventeen.min.css +0 -1
  414. bp-templates/bp-legacy/css/twentyseventeen.scss +0 -3194
  415. bp-templates/bp-legacy/css/twentysixteen-rtl.css +49 -55
  416. bp-templates/bp-legacy/css/twentysixteen-rtl.min.css +1 -1
  417. bp-templates/bp-legacy/css/twentysixteen.css +49 -55
  418. bp-templates/bp-legacy/css/twentysixteen.min.css +1 -1
  419. bp-templates/bp-legacy/css/twentysixteen.scss +67 -342
  420. bp-templates/bp-legacy/css/twentyten-rtl.css +51 -47
  421. bp-templates/bp-legacy/css/twentyten-rtl.min.css +1 -1
  422. bp-templates/bp-legacy/css/twentyten.css +51 -47
  423. bp-templates/bp-legacy/css/twentyten.min.css +1 -1
  424. bp-templates/bp-legacy/css/twentyten.scss +78 -325
  425. bp-templates/bp-legacy/css/twentythirteen-rtl.css +51 -47
  426. bp-templates/bp-legacy/css/twentythirteen-rtl.min.css +1 -1
  427. bp-templates/bp-legacy/css/twentythirteen.css +51 -47
  428. bp-templates/bp-legacy/css/twentythirteen.min.css +1 -1
  429. bp-templates/bp-legacy/css/twentythirteen.scss +67 -328
  430. bp-templates/bp-legacy/css/twentytwelve-rtl.css +49 -45
  431. bp-templates/bp-legacy/css/twentytwelve-rtl.min.css +1 -1
  432. bp-templates/bp-legacy/css/twentytwelve.css +49 -45
  433. bp-templates/bp-legacy/css/twentytwelve.min.css +1 -1
  434. bp-templates/bp-legacy/css/twentytwelve.scss +89 -337
  435. bp-templates/bp-legacy/js/buddypress.js +116 -56
  436. bp-templates/bp-legacy/js/buddypress.min.js +2 -1
  437. bp-templates/bp-legacy/js/password-verify.min.js +1 -1
  438. bp-themes/bp-default/_inc/ajax.php +6 -37
  439. bp-themes/bp-default/_inc/global.js +4 -40
  440. bp-xprofile/admin/css/admin-rtl.css +190 -247
  441. bp-xprofile/admin/css/admin-rtl.min.css +1 -1
  442. bp-xprofile/admin/css/admin.css +190 -247
  443. bp-xprofile/admin/css/admin.min.css +1 -1
  444. bp-xprofile/admin/js/admin.js +0 -2
  445. bp-xprofile/admin/js/admin.min.js +1 -1
  446. bp-xprofile/bp-xprofile-activity.php +1 -1
  447. bp-xprofile/bp-xprofile-admin.php +44 -110
  448. bp-xprofile/bp-xprofile-cache.php +0 -10
  449. bp-xprofile/bp-xprofile-caps.php +3 -12
  450. bp-xprofile/bp-xprofile-classes.php +28 -0
  451. bp-xprofile/bp-xprofile-filters.php +7 -17
  452. bp-xprofile/bp-xprofile-functions.php +7 -37
  453. bp-xprofile/bp-xprofile-loader.php +4 -0
  454. bp-xprofile/bp-xprofile-screens.php +13 -2
  455. bp-xprofile/bp-xprofile-settings.php +1 -1
  456. bp-xprofile/bp-xprofile-template.php +49 -79
  457. bp-xprofile/classes/class-bp-xprofile-component.php +4 -0
  458. bp-xprofile/classes/class-bp-xprofile-data-template.php +2 -1
  459. bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php +4 -5
  460. bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php +3 -7
  461. bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php +3 -7
  462. bp-xprofile/classes/class-bp-xprofile-field-type-number.php +3 -7
  463. bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php +5 -5
  464. bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php +3 -7
  465. bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php +3 -7
  466. bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php +3 -7
  467. bp-xprofile/classes/class-bp-xprofile-field-type-url.php +3 -7
  468. bp-xprofile/classes/class-bp-xprofile-field.php +8 -20
  469. bp-xprofile/classes/class-bp-xprofile-group.php +1 -4
  470. bp-xprofile/classes/class-bp-xprofile-profiledata.php +2 -2
  471. bp-xprofile/classes/class-bp-xprofile-user-admin.php +20 -9
  472. buddypress.pot +9642 -0
  473. class-buddypress.php +0 -736
  474. composer.json +2 -2
  475. humans.txt +1 -11
  476. readme.txt +204 -121
bp-activity/admin/css/admin-rtl.css CHANGED
@@ -1,20 +1,16 @@
1
.akismet-status {
2
float: left;
3
}
4
-
5
.akismet-status a {
6
- color: #aaa;
7
font-style: italic;
8
}
9
-
10
.akismet-history {
11
margin: 13px;
12
}
13
-
14
.akismet-history div {
15
margin-bottom: 13px;
16
}
17
-
18
.akismet-history span {
19
color: #999;
20
}
@@ -22,43 +18,36 @@
22
#wp-bp-activities-wrap {
23
padding: 5px 0;
24
}
25
-
26
#bp-activities {
27
height: 120px;
28
}
29
-
30
#bp-replyhead {
31
font-size: 1em;
32
- line-height: 1.4;
33
margin: 0;
34
}
35
-
36
#bp-replysubmit {
37
margin: 0;
38
padding: 0 0 3px;
39
text-align: center;
40
}
41
-
42
#bp-replysubmit .error {
43
- color: #f00;
44
line-height: 21px;
45
text-align: center;
46
vertical-align: center;
47
}
48
-
49
#bp-replysubmit img.waiting {
50
float: left;
51
padding: 4px 10px 0;
52
vertical-align: top;
53
}
54
-
55
#bp-activities-form .column-response img {
56
float: right;
57
margin-bottom: 5px;
58
margin-left: 10px;
59
margin-top: 1px;
60
}
61
-
62
.activity-errors {
63
list-style-type: disc;
64
margin-right: 2em;
@@ -68,38 +57,31 @@
68
#bp_activity_content div.inside {
69
line-height: 0;
70
}
71
-
72
#bp_activity_action h3,
73
#bp_activity_content h3 {
74
cursor: auto;
75
}
76
-
77
#bp_activity_action td.mceIframeContainer,
78
#bp_activity_content td.mceIframeContainer {
79
- background-color: #fff;
80
}
81
-
82
#post-body #bp-activities-action_resize,
83
#post-body #bp-activities-content_resize {
84
position: inherit;
85
margin-top: -2px;
86
}
87
-
88
#bp_activity_link input {
89
width: 99%;
90
}
91
-
92
#bp-activities-primaryid {
93
margin-bottom: 1em;
94
}
95
-
96
.column-action {
97
width: 12%;
98
}
99
100
@media screen and (max-width: 782px) {
101
-
102
body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column) {
103
display: table-cell;
104
}
105
- }
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
}
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;
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 CHANGED
@@ -1 +1 @@
1
- .akismet-status{float:left}.akismet-status a{color:#aaa;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:left;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:right;margin-bottom:5px;margin-left:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-right:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}@media screen and (max-width:782px){body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){display:table-cell}}
1
+ .akismet-status{float:left}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:left;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:right;margin-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 CHANGED
@@ -1,20 +1,16 @@
1
.akismet-status {
2
float: right;
3
}
4
-
5
.akismet-status a {
6
- color: #aaa;
7
font-style: italic;
8
}
9
-
10
.akismet-history {
11
margin: 13px;
12
}
13
-
14
.akismet-history div {
15
margin-bottom: 13px;
16
}
17
-
18
.akismet-history span {
19
color: #999;
20
}
@@ -22,43 +18,36 @@
22
#wp-bp-activities-wrap {
23
padding: 5px 0;
24
}
25
-
26
#bp-activities {
27
height: 120px;
28
}
29
-
30
#bp-replyhead {
31
font-size: 1em;
32
- line-height: 1.4;
33
margin: 0;
34
}
35
-
36
#bp-replysubmit {
37
margin: 0;
38
padding: 0 0 3px;
39
text-align: center;
40
}
41
-
42
#bp-replysubmit .error {
43
- color: #f00;
44
line-height: 21px;
45
text-align: center;
46
vertical-align: center;
47
}
48
-
49
#bp-replysubmit img.waiting {
50
float: right;
51
padding: 4px 10px 0;
52
vertical-align: top;
53
}
54
-
55
#bp-activities-form .column-response img {
56
float: left;
57
margin-bottom: 5px;
58
margin-right: 10px;
59
margin-top: 1px;
60
}
61
-
62
.activity-errors {
63
list-style-type: disc;
64
margin-left: 2em;
@@ -68,38 +57,31 @@
68
#bp_activity_content div.inside {
69
line-height: 0;
70
}
71
-
72
#bp_activity_action h3,
73
#bp_activity_content h3 {
74
cursor: auto;
75
}
76
-
77
#bp_activity_action td.mceIframeContainer,
78
#bp_activity_content td.mceIframeContainer {
79
- background-color: #fff;
80
}
81
-
82
#post-body #bp-activities-action_resize,
83
#post-body #bp-activities-content_resize {
84
position: inherit;
85
margin-top: -2px;
86
}
87
-
88
#bp_activity_link input {
89
width: 99%;
90
}
91
-
92
#bp-activities-primaryid {
93
margin-bottom: 1em;
94
}
95
-
96
.column-action {
97
width: 12%;
98
}
99
100
@media screen and (max-width: 782px) {
101
-
102
body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column) {
103
display: table-cell;
104
}
105
- }
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
}
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;
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 CHANGED
@@ -1 +1 @@
1
- .akismet-status{float:right}.akismet-status a{color:#aaa;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-bottom:5px;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}@media screen and (max-width:782px){body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){display:table-cell}}
1
+ .akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-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.min.js CHANGED
@@ -1 +1 @@
1
- !function(i){var t={init:function(){i(document).on("click",".row-actions a.reply",t.open),i(document).on("click","#bp-activities-container a.cancel",t.close),i(document).on("click","#bp-activities-container a.save",t.send),i(document).on("keyup","#bp-activities:visible",function(i){27===i.which&&t.close()})},open:function(){var t=i("#bp-activities-container").hide();return i(this).parents("tr").after(t),t.fadeIn("300"),i("#bp-activities").focus(),!1},close:function(){return i("#bp-activities-container").fadeOut("200",function(){i("#bp-activities").val("").blur(),i("#bp-replysubmit .error").html("").hide(),i("#bp-replysubmit .waiting").hide()}),!1},send:function(){i("#bp-replysubmit .error").hide(),i("#bp-replysubmit .waiting").show();var e={};return e["_ajax_nonce-bp-activity-admin-reply"]=i('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),e.action="bp-activity-admin-reply",e.content=i("#bp-activities").val(),e.parent_id=i("#bp-activities-container").prev().data("parent_id"),e.root_id=i("#bp-activities-container").prev().data("root_id"),i.ajax({data:e,type:"POST",url:ajaxurl,error:function(i){t.error(i)},success:function(i){t.show(i)}}),!1},error:function(t){var e=t.statusText;i("#bp-replysubmit .waiting").hide(),t.responseText&&(e=t.responseText.replace(/<.[^<>]*?>/g,"")),e&&i("#bp-replysubmit .error").html(e).show()},show:function(e){var n,a,r;return"string"==typeof e?(t.error({responseText:e}),!1):(r=wpAjax.parseAjaxResponse(e)).errors?(t.error({responseText:wpAjax.broken}),!1):(r=r.responses[0],void i("#bp-activities-container").fadeOut("200",function(){i("#bp-activities").val("").blur(),i("#bp-replysubmit .error").html("").hide(),i("#bp-replysubmit .waiting").hide(),i("#bp-activities-container").before(r.data),a=i("#activity-"+r.id),n=a.closest(".widefat").css("backgroundColor"),a.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:n},300)}))}};i(document).ready(function(){t.init(),i("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
1
+ !function(a){var b={init:function(){a(document).on("click",".row-actions a.reply",b.open),a(document).on("click","#bp-activities-container a.cancel",b.close),a(document).on("click","#bp-activities-container a.save",b.send),a(document).on("keyup","#bp-activities:visible",function(a){27===a.which&&b.close()})},open:function(){var b=a("#bp-activities-container").hide();return a(this).parents("tr").after(b),b.fadeIn("300"),a("#bp-activities").focus(),!1},close:function(){return a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide()}),!1},send:function(){a("#bp-replysubmit .error").hide(),a("#bp-replysubmit .waiting").show();var c={};return c["_ajax_nonce-bp-activity-admin-reply"]=a('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),c.action="bp-activity-admin-reply",c.content=a("#bp-activities").val(),c.parent_id=a("#bp-activities-container").prev().data("parent_id"),c.root_id=a("#bp-activities-container").prev().data("root_id"),a.ajax({data:c,type:"POST",url:ajaxurl,error:function(a){b.error(a)},success:function(a){b.show(a)}}),!1},error:function(b){var c=b.statusText;a("#bp-replysubmit .waiting").hide(),b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&a("#bp-replysubmit .error").html(c).show()},show:function(c){var d,e,f;return"string"==typeof c?(b.error({responseText:c}),!1):(f=wpAjax.parseAjaxResponse(c),f.errors?(b.error({responseText:wpAjax.broken}),!1):(f=f.responses[0],void a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide(),a("#bp-activities-container").before(f.data),e=a("#activity-"+f.id),d=e.closest(".widefat").css("backgroundColor"),e.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:d},300)})))}};a(document).ready(function(){b.init(),a("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
bp-activity/bp-activity-actions.php CHANGED
@@ -832,11 +832,7 @@ function bp_activity_transition_post_type_comment_status( $new_status, $old_stat
832
833
// Add "new_post_type_comment" to the whitelisted activity types, so that the activity's Akismet history is generated
834
$post_type_comment_action = $activity_comment_object->action_id;
835
- $comment_akismet_history = function ( $activity_types ) use ( $post_type_comment_action ) {
836
- $activity_types[] = $post_type_comment_action;
837
-
838
- return $activity_types;
839
- };
840
add_filter( 'bp_akismet_get_activity_types', $comment_akismet_history );
841
842
// Make sure the activity change won't edit the comment if sync is on
832
833
// Add "new_post_type_comment" to the whitelisted activity types, so that the activity's Akismet history is generated
834
$post_type_comment_action = $activity_comment_object->action_id;
835
+ $comment_akismet_history = create_function( '$t', '$t[] = $post_type_comment_action; return $t;' );
836
add_filter( 'bp_akismet_get_activity_types', $comment_akismet_history );
837
838
// Make sure the activity change won't edit the comment if sync is on
bp-activity/bp-activity-admin.php CHANGED
@@ -16,6 +16,10 @@ defined( 'ABSPATH' ) || exit;
16
// Include WP's list table class.
17
if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
18
19
// Per_page screen option. Has to be hooked in extremely early.
20
if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' == $_REQUEST['page'] )
21
add_filter( 'set-screen-option', 'bp_activity_admin_screen_options', 10, 3 );
@@ -141,7 +145,7 @@ add_action( 'wp_ajax_bp-activity-admin-reply', 'bp_activity_admin_reply' );
141
* @param string $value Will always be false unless another plugin filters it first.
142
* @param string $option Screen option name.
143
* @param string $new_value Screen option form value.
144
- * @return string|int Option value. False to abandon update.
145
*/
146
function bp_activity_admin_screen_options( $value, $option, $new_value ) {
147
if ( 'toplevel_page_bp_activity_per_page' != $option && 'toplevel_page_bp_activity_network_per_page' != $option )
@@ -165,9 +169,8 @@ function bp_activity_admin_screen_options( $value, $option, $new_value ) {
165
* @return array Hidden Meta Boxes.
166
*/
167
function bp_activity_admin_edit_hidden_metaboxes( $hidden, $screen ) {
168
- if ( empty( $screen->id ) || 'toplevel_page_bp-activity' !== $screen->id && 'toplevel_page_bp-activity-network' !== $screen->id ) {
169
return $hidden;
170
- }
171
172
// Hide the primary link meta box by default.
173
$hidden = array_merge( (array) $hidden, array( 'bp_activity_itemids', 'bp_activity_link', 'bp_activity_type', 'bp_activity_userid', ) );
@@ -390,8 +393,8 @@ function bp_activity_admin_load() {
390
* Remove moderation and blacklist checks in case we want to ham an activity
391
* which contains one of these listed keys.
392
*/
393
- remove_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2 );
394
- remove_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys', 2 );
395
396
bp_activity_mark_as_ham( $activity );
397
$result = $activity->save();
16
// Include WP's list table class.
17
if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
18
19
+ if ( ! buddypress()->do_autoload ) {
20
+ require dirname( __FILE__ ) . '/classes/class-bp-activity-list-table.php';
21
+ }
22
+
23
// Per_page screen option. Has to be hooked in extremely early.
24
if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' == $_REQUEST['page'] )
25
add_filter( 'set-screen-option', 'bp_activity_admin_screen_options', 10, 3 );
145
* @param string $value Will always be false unless another plugin filters it first.
146
* @param string $option Screen option name.
147
* @param string $new_value Screen option form value.
148
+ * @return string Option value. False to abandon update.
149
*/
150
function bp_activity_admin_screen_options( $value, $option, $new_value ) {
151
if ( 'toplevel_page_bp_activity_per_page' != $option && 'toplevel_page_bp_activity_network_per_page' != $option )
169
* @return array Hidden Meta Boxes.
170
*/
171
function bp_activity_admin_edit_hidden_metaboxes( $hidden, $screen ) {
172
+ if ( empty( $screen->id ) || 'toplevel_page_bp-activity' != $screen->id && 'toplevel_page_bp-activity_network' != $screen->id )
173
return $hidden;
174
175
// Hide the primary link meta box by default.
176
$hidden = array_merge( (array) $hidden, array( 'bp_activity_itemids', 'bp_activity_link', 'bp_activity_type', 'bp_activity_userid', ) );
393
* Remove moderation and blacklist checks in case we want to ham an activity
394
* which contains one of these listed keys.
395
*/
396
+ remove_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2, 1 );
397
+ remove_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys', 2, 1 );
398
399
bp_activity_mark_as_ham( $activity );
400
$result = $activity->save();
bp-activity/bp-activity-akismet.php CHANGED
@@ -10,6 +10,10 @@
10
// Exit if accessed directly.
11
defined( 'ABSPATH' ) || exit;
12
13
/**
14
* Loads Akismet filtering for activity.
15
*
10
// Exit if accessed directly.
11
defined( 'ABSPATH' ) || exit;
12
13
+ if ( ! buddypress()->do_autoload ) {
14
+ require dirname( __FILE__ ) . '/classes/class-bp-akismet.php';
15
+ }
16
+
17
/**
18
* Loads Akismet filtering for activity.
19
*
bp-activity/bp-activity-classes.php ADDED
@@ -0,0 +1,20 @@
1
+ <?php
2
+ /**
3
+ * BuddyPress Activity Classes.
4
+ *
5
+ * @package BuddyPress
6
+ * @subpackage ActivityClasses
7
+ * @since 1.0.0
8
+ */
9
+
10
+ // Exit if accessed directly.
11
+ defined( 'ABSPATH' ) || exit;
12
+
13
+ require dirname( __FILE__ ) . '/classes/class-bp-activity-activity.php';
14
+ require dirname( __FILE__ ) . '/classes/class-bp-activity-feed.php';
15
+ require dirname( __FILE__ ) . '/classes/class-bp-activity-query.php';
16
+
17
+ // Embeds - only applicable for WP 4.5+
18
+ if ( version_compare( $GLOBALS['wp_version'], '4.5', '>=' ) && bp_is_active( 'activity', 'embeds' ) ) {
19
+ require dirname( __FILE__ ) . '/classes/class-bp-activity-oembed-extension.php';
20
+ }
bp-activity/bp-activity-embeds.php CHANGED
@@ -123,7 +123,7 @@ function bp_activity_embed_has_activity( $activity_id = 0 ) {
123
* @since 2.6.0
124
*/
125
function bp_activity_embed_excerpt( $content = '' ) {
126
- echo bp_activity_get_embed_excerpt( $content );
127
}
128
129
/**
123
* @since 2.6.0
124
*/
125
function bp_activity_embed_excerpt( $content = '' ) {
126
+ echo bp_activity_get_embed_excerpt( $content = '' );
127
}
128
129
/**
bp-activity/bp-activity-filters.php CHANGED
@@ -207,12 +207,10 @@ function bp_activity_filter_kses( $content ) {
207
global $allowedtags;
208
209
$activity_allowedtags = $allowedtags;
210
- $activity_allowedtags['a']['aria-label'] = array();
211
- $activity_allowedtags['a']['class'] = array();
212
- $activity_allowedtags['a']['data-bp-tooltip'] = array();
213
- $activity_allowedtags['a']['id'] = array();
214
- $activity_allowedtags['a']['rel'] = array();
215
- $activity_allowedtags['a']['title'] = array();
216
217
$activity_allowedtags['b'] = array();
218
$activity_allowedtags['code'] = array();
@@ -225,14 +223,12 @@ function bp_activity_filter_kses( $content ) {
225
$activity_allowedtags['img']['height'] = array();
226
$activity_allowedtags['img']['class'] = array();
227
$activity_allowedtags['img']['id'] = array();
228
229
$activity_allowedtags['span'] = array();
230
$activity_allowedtags['span']['class'] = array();
231
$activity_allowedtags['span']['data-livestamp'] = array();
232
233
- $activity_allowedtags['ul'] = array();
234
- $activity_allowedtags['ol'] = array();
235
- $activity_allowedtags['li'] = array();
236
237
/**
238
* Filters the allowed HTML tags for BuddyPress Activity content.
@@ -454,7 +450,14 @@ function bp_activity_truncate_entry( $text, $args = array() ) {
454
*/
455
$append_text = apply_filters( 'bp_activity_excerpt_append_text', __( '[Read more]', 'buddypress' ) );
456
457
- $excerpt_length = bp_activity_get_excerpt_length();
458
459
$args = wp_parse_args( $args, array( 'ending' => __( '&hellip;', 'buddypress' ) ) );
460
@@ -600,7 +603,7 @@ function bp_activity_heartbeat_last_recorded( $response = array(), $data = array
600
ob_end_clean();
601
602
// Remove the temporary filter.
603
- remove_filter( 'bp_get_activity_css_class', 'bp_activity_newest_class', 10 );
604
605
if ( ! empty( $newest_activities['last_recorded'] ) ) {
606
$response['bp_activity_newest_activities'] = $newest_activities;
207
global $allowedtags;
208
209
$activity_allowedtags = $allowedtags;
210
+ $activity_allowedtags['a']['class'] = array();
211
+ $activity_allowedtags['a']['id'] = array();
212
+ $activity_allowedtags['a']['rel'] = array();
213
+ $activity_allowedtags['a']['title'] = array();
214
215
$activity_allowedtags['b'] = array();
216
$activity_allowedtags['code'] = array();
223
$activity_allowedtags['img']['height'] = array();
224
$activity_allowedtags['img']['class'] = array();
225
$activity_allowedtags['img']['id'] = array();
226
+ $activity_allowedtags['img']['title'] = array();
227
228
$activity_allowedtags['span'] = array();
229
$activity_allowedtags['span']['class'] = array();
230
$activity_allowedtags['span']['data-livestamp'] = array();
231
232
233
/**
234
* Filters the allowed HTML tags for BuddyPress Activity content.
450
*/
451
$append_text = apply_filters( 'bp_activity_excerpt_append_text', __( '[Read more]', 'buddypress' ) );
452
453
+ /**
454
+ * Filters the excerpt length for the activity excerpt.
455
+ *
456
+ * @since 1.5.0
457
+ *
458
+ * @param int $value Number indicating how many words to trim the excerpt down to.
459
+ */
460
+ $excerpt_length = apply_filters( 'bp_activity_excerpt_length', 358 );
461
462
$args = wp_parse_args( $args, array( 'ending' => __( '&hellip;', 'buddypress' ) ) );
463
603
ob_end_clean();
604
605
// Remove the temporary filter.
606
+ remove_filter( 'bp_get_activity_css_class', 'bp_activity_newest_class', 10, 1 );
607
608
if ( ! empty( $newest_activities['last_recorded'] ) ) {
609
$response['bp_activity_newest_activities'] = $newest_activities;
bp-activity/bp-activity-functions.php CHANGED
@@ -406,7 +406,7 @@ function bp_activity_set_action( $component_id, $type, $description, $format_cal
406
* @param array $args {
407
* An associative array of tracking parameters. All items are optional.
408
* @type string $bp_activity_admin_filter String to use in the Dashboard > Activity dropdown.
409
- * @type string $bp_activity_front_filter String to use in the front-end dropdown.
410
* @type string $bp_activity_new_post String format to use for generating the activity action. Should be a
411
* translatable string where %1$s is replaced by a user link and %2$s is
412
* the URL of the newly created post.
@@ -839,63 +839,6 @@ function bp_activity_get_types() {
839
return apply_filters( 'bp_activity_get_types', $actions );
840
}
841
842
- /**
843
- * Gets the current activity context.
844
- *
845
- * The "context" is the current view type, corresponding roughly to the
846
- * current component. Use this context to determine which activity actions
847
- * should be whitelisted for the filter dropdown.
848
- *
849
- * @since 2.8.0
850
- *
851
- * @return string Activity context. 'member', 'member_groups', 'group', 'activity'.
852
- */
853
- function bp_activity_get_current_context() {
854
- // On member pages, default to 'member', unless this is a user's Groups activity.
855
- if ( bp_is_user() ) {
856
- if ( bp_is_active( 'groups' ) && bp_is_current_action( bp_get_groups_slug() ) ) {
857
- $context = 'member_groups';
858
- } else {
859
- $context = 'member';
860
- }
861
-
862
- // On individual group pages, default to 'group'.
863
- } elseif ( bp_is_active( 'groups' ) && bp_is_group() ) {
864
- $context = 'group';
865
-
866
- // 'activity' everywhere else.
867
- } else {
868
- $context = 'activity';
869
- }
870
-
871
- return $context;
872
- }
873
-
874
- /**
875
- * Gets a flat list of activity actions compatible with a given context.
876
- *
877
- * @since 2.8.0
878
- *
879
- * @param string $context Optional. Name of the context. Defaults to the current context.
880
- * @return array
881
- */
882
- function bp_activity_get_actions_for_context( $context = '' ) {
883
- if ( ! $context ) {
884
- $context = bp_activity_get_current_context();
885
- }
886
-
887
- $actions = array();
888
- foreach ( bp_activity_get_actions() as $component_actions ) {
889
- foreach ( $component_actions as $component_action ) {
890
- if ( in_array( $context, (array) $component_action['context'], true ) ) {
891
- $actions[] = $component_action;
892
- }
893
- }
894
- }
895
-
896
- return $actions;
897
- }
898
-
899
/** Favorites ****************************************************************/
900
901
/**
@@ -1502,7 +1445,7 @@ function bp_activity_generate_action_string( $activity ) {
1502
$action = apply_filters( 'bp_activity_generate_action_string', $activity->action, $activity );
1503
1504
// Remove the filter for future activity items.
1505
- remove_filter( 'bp_activity_generate_action_string', $actions->{$activity->component}->{$activity->type}['format_callback'], 10 );
1506
1507
return $action;
1508
}
@@ -1781,7 +1724,7 @@ function bp_activity_get_specific( $args = '' ) {
1781
'sort' => 'DESC', // Sort ASC or DESC
1782
'spam' => 'ham_only', // Retrieve items marked as spam.
1783
'update_meta_cache' => true,
1784
- ), 'activity_get_specific' );
1785
1786
$get_args = array(
1787
'display_comments' => $r['display_comments'],
@@ -1845,7 +1788,7 @@ function bp_activity_get_specific( $args = '' ) {
1845
* @type bool $is_spam Should the item be marked as spam? Default: false.
1846
* @type string $error_type Optional. Error type. Either 'bool' or 'wp_error'. Default: 'bool'.
1847
* }
1848
- * @return WP_Error|bool|int The ID of the activity on success. False on error.
1849
*/
1850
function bp_activity_add( $args = '' ) {
1851
@@ -2026,7 +1969,7 @@ function bp_activity_post_update( $args = '' ) {
2026
* @param int $post_id ID of the new post.
2027
* @param WP_Post|null $post Post object.
2028
* @param int $user_id ID of the post author.
2029
- * @return null|WP_Error|bool|int The ID of the activity on success. False on error.
2030
*/
2031
function bp_activity_post_type_publish( $post_id = 0, $post = null, $user_id = 0 ) {
2032
@@ -2161,7 +2104,7 @@ function bp_activity_post_type_publish( $post_id = 0, $post = null, $user_id = 0
2161
* @since 2.2.0
2162
*
2163
* @param WP_Post|null $post Post item.
2164
- * @return null|WP_Error|bool True on success, false on failure.
2165
*/
2166
function bp_activity_post_type_update( $post = null ) {
2167
@@ -2283,7 +2226,7 @@ function bp_activity_post_type_unpublish( $post_id = 0, $post = null ) {
2283
* @param int $comment_id ID of the comment.
2284
* @param bool $is_approved Whether the comment is approved or not.
2285
* @param object|null $activity_post_object The post type tracking args object.
2286
- * @return null|WP_Error|bool|int The ID of the activity on success. False on error.
2287
*/
2288
function bp_activity_post_type_comment( $comment_id = 0, $is_approved = true, $activity_post_object = null ) {
2289
// Get the users comment
@@ -2557,7 +2500,7 @@ add_action( 'delete_comment', 'bp_activity_post_type_remove_comment', 10, 1 );
2557
* Defaults to false.
2558
* @type string $error_type Optional. Error type. Either 'bool' or 'wp_error'. Default: 'bool'.
2559
* }
2560
- * @return WP_Error|bool|int The ID of the comment on success, otherwise false.
2561
*/
2562
function bp_activity_new_comment( $args = '' ) {
2563
$bp = buddypress();
@@ -2672,9 +2615,9 @@ function bp_activity_new_comment( $args = '' ) {
2672
*
2673
* @since 1.2.0
2674
*
2675
- * @param int $comment_id ID of the newly posted activity comment.
2676
- * @param array $r Array of parsed comment arguments.
2677
- * @param BP_Activity_Activity $activity Activity item being commented on.
2678
*/
2679
do_action( 'bp_activity_comment_posted', $comment_id, $r, $activity );
2680
} else {
@@ -2684,9 +2627,9 @@ function bp_activity_new_comment( $args = '' ) {
2684
*
2685
* @since 2.5.0
2686
*
2687
- * @param int $comment_id ID of the newly posted activity comment.
2688
- * @param array $r Array of parsed comment arguments.
2689
- * @param BP_Activity_Activity $activity Activity item being commented on.
2690
*/
2691
do_action( 'bp_activity_comment_posted_notification_skipped', $comment_id, $r, $activity );
2692
}
@@ -2963,12 +2906,6 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
2963
return $deleted;
2964
}
2965
2966
- // Check if comment still exists.
2967
- $comment = new BP_Activity_Activity( $comment_id );
2968
- if ( empty( $comment->id ) ) {
2969
- return false;
2970
- }
2971
-
2972
// Delete any children of this comment.
2973
bp_activity_delete_children( $activity_id, $comment_id );
2974
@@ -3009,11 +2946,6 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
3009
* @param int $comment_id The ID of the comment to be deleted.
3010
*/
3011
function bp_activity_delete_children( $activity_id, $comment_id ) {
3012
- // Check if comment still exists.
3013
- $comment = new BP_Activity_Activity( $comment_id );
3014
- if ( empty( $comment->id ) ) {
3015
- return;
3016
- }
3017
3018
// Get activity children to delete.
3019
$children = BP_Activity_Activity::get_child_comments( $comment_id );
@@ -3180,24 +3112,6 @@ function bp_activity_thumbnail_content_images( $content, $link = false, $args =
3180
return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches, $args );
3181
}
3182
3183
- /**
3184
- * Gets the excerpt length for activity items.
3185
- *
3186
- * @since 2.8.0
3187
- *
3188
- * @return int Character length for activity excerpts.
3189
- */
3190
- function bp_activity_get_excerpt_length() {
3191
- /**
3192
- * Filters the excerpt length for the activity excerpt.
3193
- *
3194
- * @since 1.5.0
3195
- *
3196
- * @param int Character length for activity excerpts.
3197
- */
3198
- return (int) apply_filters( 'bp_activity_excerpt_length', 358 );
3199
- }
3200
-
3201
/**
3202
* Create a rich summary of an activity item for the activity stream.
3203
*
@@ -3407,7 +3321,7 @@ function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
3407
3408
// If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity.
3409
if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) {
3410
- remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4 );
3411
3412
// Build data package for Akismet.
3413
$activity_data = BP_Akismet::build_akismet_data_package( $activity );
@@ -3454,7 +3368,7 @@ function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
3454
3455
// If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity.
3456
if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) {
3457
- remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4 );
3458
3459
// Build data package for Akismet.
3460
$activity_data = BP_Akismet::build_akismet_data_package( $activity );
@@ -3509,7 +3423,7 @@ function bp_activity_at_message_notification( $activity_id, $receiver_user_id )
3509
remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
3510
3511
/** This filter is documented in bp-activity/bp-activity-template.php */
3512
- $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $activity->content, &$activity ) );
3513
3514
add_filter( 'bp_get_activity_content_body', 'convert_smilies' );
3515
add_filter( 'bp_get_activity_content_body', 'wpautop' );
@@ -3577,7 +3491,7 @@ function bp_activity_new_comment_notification( $comment_id = 0, $commenter_id =
3577
remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
3578
3579
/** This filter is documented in bp-activity/bp-activity-template.php */
3580
- $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $params['content'], &$original_activity ) );
3581
3582
add_filter( 'bp_get_activity_content_body', 'convert_smilies' );
3583
add_filter( 'bp_get_activity_content_body', 'wpautop' );
@@ -3761,7 +3675,7 @@ add_action( 'bp_before_activity_comment', 'bp_activity_comment_embed' );
3761
function bp_dtheme_embed_read_more( $activity ) {
3762
buddypress()->activity->read_more_id = $activity->id;
3763
3764
- add_filter( 'embed_post_id', function() { return buddypress()->activity->read_more_id; } );
3765
add_filter( 'bp_embed_get_cache', 'bp_embed_activity_cache', 10, 3 );
3766
add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 );
3767
}
@@ -3831,21 +3745,21 @@ function bp_embed_activity_save_cache( $cache, $cachekey, $id ) {
3831
*
3832
* @since 2.0.0
3833
*
3834
* @return bool True if activity heartbeat is enabled, otherwise false.
3835
*/
3836
function bp_activity_do_heartbeat() {
3837
$retval = false;
3838
3839
- if ( bp_is_activity_heartbeat_active() && ( bp_is_activity_directory() || bp_is_group_activity() ) ) {
3840
$retval = true;
3841
}
3842
3843
- /**
3844
- * Filters whether the heartbeat feature in the activity stream should be active.
3845
- *
3846
- * @since 2.8.0
3847
- *
3848
- * @param bool $retval Whether or not activity heartbeat is active.
3849
- */
3850
- return (bool) apply_filters( 'bp_activity_do_heartbeat', $retval );
3851
}
406
* @param array $args {
407
* An associative array of tracking parameters. All items are optional.
408
* @type string $bp_activity_admin_filter String to use in the Dashboard > Activity dropdown.
409
+ * @type string $bp_activity_front_filter String to use in frontend dropdown.
410
* @type string $bp_activity_new_post String format to use for generating the activity action. Should be a
411
* translatable string where %1$s is replaced by a user link and %2$s is
412
* the URL of the newly created post.
839
return apply_filters( 'bp_activity_get_types', $actions );
840
}
841
842
/** Favorites ****************************************************************/
843
844
/**
1445
$action = apply_filters( 'bp_activity_generate_action_string', $activity->action, $activity );
1446
1447
// Remove the filter for future activity items.
1448
+ remove_filter( 'bp_activity_generate_action_string', $actions->{$activity->component}->{$activity->type}['format_callback'], 10, 2 );
1449
1450
return $action;
1451
}
1724
'sort' => 'DESC', // Sort ASC or DESC
1725
'spam' => 'ham_only', // Retrieve items marked as spam.
1726
'update_meta_cache' => true,
1727
+ ) );
1728
1729
$get_args = array(
1730
'display_comments' => $r['display_comments'],
1788
* @type bool $is_spam Should the item be marked as spam? Default: false.
1789
* @type string $error_type Optional. Error type. Either 'bool' or 'wp_error'. Default: 'bool'.
1790
* }
1791
+ * @return int|bool The ID of the activity on success. False on error.
1792
*/
1793
function bp_activity_add( $args = '' ) {
1794
1969
* @param int $post_id ID of the new post.
1970
* @param WP_Post|null $post Post object.
1971
* @param int $user_id ID of the post author.
1972
+ * @return int|bool The ID of the activity on success. False on error.
1973
*/
1974
function bp_activity_post_type_publish( $post_id = 0, $post = null, $user_id = 0 ) {
1975
2104
* @since 2.2.0
2105
*
2106
* @param WP_Post|null $post Post item.
2107
+ * @return bool True on success, false on failure.
2108
*/
2109
function bp_activity_post_type_update( $post = null ) {
2110
2226
* @param int $comment_id ID of the comment.
2227
* @param bool $is_approved Whether the comment is approved or not.
2228
* @param object|null $activity_post_object The post type tracking args object.
2229
+ * @return int|bool The ID of the activity on success. False on error.
2230
*/
2231
function bp_activity_post_type_comment( $comment_id = 0, $is_approved = true, $activity_post_object = null ) {
2232
// Get the users comment
2500
* Defaults to false.
2501
* @type string $error_type Optional. Error type. Either 'bool' or 'wp_error'. Default: 'bool'.
2502
* }
2503
+ * @return int|bool The ID of the comment on success, otherwise false.
2504
*/
2505
function bp_activity_new_comment( $args = '' ) {
2506
$bp = buddypress();
2615
*
2616
* @since 1.2.0
2617
*
2618
+ * @param int $comment_id ID of the newly posted activity comment.
2619
+ * @param array $r Array of parsed comment arguments.
2620
+ * @param int $activity ID of the activity item being commented on.
2621
*/
2622
do_action( 'bp_activity_comment_posted', $comment_id, $r, $activity );
2623
} else {
2627
*
2628
* @since 2.5.0
2629
*
2630
+ * @param int $comment_id ID of the newly posted activity comment.
2631
+ * @param array $r Array of parsed comment arguments.
2632
+ * @param int $activity ID of the activity item being commented on.
2633
*/
2634
do_action( 'bp_activity_comment_posted_notification_skipped', $comment_id, $r, $activity );
2635
}
2906
return $deleted;
2907
}
2908
2909
// Delete any children of this comment.
2910
bp_activity_delete_children( $activity_id, $comment_id );
2911
2946
* @param int $comment_id The ID of the comment to be deleted.
2947
*/
2948
function bp_activity_delete_children( $activity_id, $comment_id ) {
2949
2950
// Get activity children to delete.
2951
$children = BP_Activity_Activity::get_child_comments( $comment_id );
3112
return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches, $args );
3113
}
3114
3115
/**
3116
* Create a rich summary of an activity item for the activity stream.
3117
*
3321
3322
// If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity.
3323
if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) {
3324
+ remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4, 1 );
3325
3326
// Build data package for Akismet.
3327
$activity_data = BP_Akismet::build_akismet_data_package( $activity );
3368
3369
// If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity.
3370
if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) {
3371
+ remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4, 1 );
3372
3373
// Build data package for Akismet.
3374
$activity_data = BP_Akismet::build_akismet_data_package( $activity );
3423
remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
3424
3425
/** This filter is documented in bp-activity/bp-activity-template.php */
3426
+ $content = apply_filters( 'bp_get_activity_content_body', $activity->content );
3427
3428
add_filter( 'bp_get_activity_content_body', 'convert_smilies' );
3429
add_filter( 'bp_get_activity_content_body', 'wpautop' );
3491
remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
3492
3493
/** This filter is documented in bp-activity/bp-activity-template.php */
3494
+ $content = apply_filters( 'bp_get_activity_content_body', $params['content'] );
3495
3496
add_filter( 'bp_get_activity_content_body', 'convert_smilies' );
3497
add_filter( 'bp_get_activity_content_body', 'wpautop' );
3675
function bp_dtheme_embed_read_more( $activity ) {
3676
buddypress()->activity->read_more_id = $activity->id;
3677
3678
+ add_filter( 'embed_post_id', create_function( '', 'return buddypress()->activity->read_more_id;' ) );
3679
add_filter( 'bp_embed_get_cache', 'bp_embed_activity_cache', 10, 3 );
3680
add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 );
3681
}
3745
*
3746
* @since 2.0.0
3747
*
3748
+ * directory.
3749
+ * is the group activities.
3750
+ *
3751
* @return bool True if activity heartbeat is enabled, otherwise false.
3752
*/
3753
function bp_activity_do_heartbeat() {
3754
$retval = false;
3755
3756
+ if ( ! bp_is_activity_heartbeat_active() ) {
3757
+ return $retval;
3758
+ }
3759
+
3760
+ if ( bp_is_activity_directory() || bp_is_group_activity() ) {
3761
$retval = true;
3762
}
3763
3764
+ return $retval;
3765
}
bp-activity/bp-activity-loader.php CHANGED
@@ -12,6 +12,10 @@
12
// Exit if accessed directly.
13
defined( 'ABSPATH' ) || exit;
14
15
/**
16
* Set up the bp-activity component.
17
*
12
// Exit if accessed directly.
13
defined( 'ABSPATH' ) || exit;
14
15
+ if ( ! buddypress()->do_autoload ) {
16
+ require dirname( __FILE__ ) . '/classes/class-bp-activity-component.php';
17
+ }
18
+
19
/**
20
* Set up the bp-activity component.
21
*
bp-activity/bp-activity-notifications.php CHANGED
@@ -94,7 +94,7 @@ function bp_activity_format_notifications( $action, $item_id, $secondary_item_id
94
* @param int $activity_id ID of the activity item being formatted.
95
* @param int $user_id ID of the user who inited the interaction.
96
*/
97
- $return = apply_filters( 'bp_activity_' . $amount . '_' . $action_filter . '_notification', '<a href="' . esc_url( $link ) . '">' . esc_html( $text ) . '</a>', $link, (int) $total_items, $activity_id, $user_id );
98
} else {
99
100
/**
94
* @param int $activity_id ID of the activity item being formatted.
95
* @param int $user_id ID of the user who inited the interaction.
96
*/
97
+ $return = apply_filters( 'bp_activity_' . $amount . '_' . $action_filter . '_notification', '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $text ) . '</a>', $link, (int) $total_items, $activity_id, $user_id );
98
} else {
99
100
/**
bp-activity/bp-activity-screens.php CHANGED
@@ -14,6 +14,10 @@
14
// Exit if accessed directly.
15
defined( 'ABSPATH' ) || exit;
16
17
/**
18
* Load the Activity directory.
19
*
14
// Exit if accessed directly.
15
defined( 'ABSPATH' ) || exit;
16
17
+ if ( ! buddypress()->do_autoload ) {
18
+ require dirname( __FILE__ ) . '/classes/class-bp-activity-theme-compat.php';
19
+ }
20
+
21
/**
22
* Load the Activity directory.
23
*
bp-activity/bp-activity-template.php CHANGED
@@ -10,6 +10,10 @@
10
// Exit if accessed directly.
11
defined( 'ABSPATH' ) || exit;
12
13
/**
14
* Output the activity component slug.
15
*
@@ -1386,8 +1390,7 @@ function bp_activity_content_body() {
1386
*
1387
* @since 1.2.0
1388
*
1389
- * @param string $content Content body.
1390
- * @param object $activity Activity object. Passed by reference.
1391
*/
1392
return apply_filters_ref_array( 'bp_get_activity_content_body', array( $activities_template->activity->content, &$activities_template->activity ) );
1393
}
@@ -1493,7 +1496,7 @@ function bp_insert_activity_meta( $content = '' ) {
1493
1494
// Setup variables for activity meta.
1495
$activity_permalink = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity );
1496
- $activity_meta = sprintf( '%1$s <a href="%2$s" class="view activity-time-since bp-tooltip" data-bp-tooltip="%3$s">%4$s</a>',
1497
$new_content,
1498
$activity_permalink,
1499
esc_attr__( 'View Discussion', 'buddypress' ),
@@ -1533,7 +1536,7 @@ function bp_insert_activity_meta( $content = '' ) {
1533
*
1534
* @global object $activities_template {@link BP_Activity_Template}
1535
*
1536
- * @param false|BP_Activity_Activity $activity Optional. Falls back on the current item in the loop.
1537
* @return bool True if can delete, false otherwise.
1538
*/
1539
function bp_activity_user_can_delete( $activity = false ) {
@@ -2090,7 +2093,7 @@ function bp_activity_comment_delete_link() {
2090
* activity comment.
2091
*/
2092
function bp_get_activity_comment_delete_link() {
2093
- $link = wp_nonce_url( trailingslashit( bp_get_activity_directory_permalink() . 'delete/' . bp_get_activity_comment_id() ) . '?cid=' . bp_get_activity_comment_id(), 'bp_activity_delete_link' );
2094
2095
/**
2096
* Filters the link used for deleting the activity comment currently being displayed.
@@ -2227,61 +2230,19 @@ function bp_activity_comment_count() {
2227
* Output the depth of the current activity comment.
2228
*
2229
* @since 2.0.0
2230
- * @since 2.8.0 Added $comment as a parameter.
2231
- *
2232
- * @param object|int $comment Object of the activity comment or activity comment ID. Usually unnecessary
2233
- * when used in activity comment loop.
2234
*/
2235
- function bp_activity_comment_depth( $comment = 0 ) {
2236
- echo bp_activity_get_comment_depth( $comment );
2237
}
2238
-
2239
/**
2240
* Return the current activity comment depth.
2241
*
2242
* @since 2.0.0
2243
- * @since 2.8.0 Added $comment as a parameter.
2244
*
2245
- * @param object|int $comment Object of the activity comment or activity comment ID. Usually unnecessary
2246
- * when used in activity comment loop.
2247
- * @return int
2248
*/
2249
- function bp_activity_get_comment_depth( $comment = 0 ) {
2250
- $depth = 0;
2251
-
2252
- // Activity comment loop takes precedence.
2253
- if ( isset( $GLOBALS['activities_template']->activity->current_comment->depth ) ) {
2254
- $depth = $GLOBALS['activities_template']->activity->current_comment->depth;
2255
-
2256
- // Get depth for activity comment manually.
2257
- } elseif ( ! empty( $comment ) ) {
2258
- // We passed an activity ID, so fetch the activity object.
2259
- if ( is_int( $comment ) ) {
2260
- $comment = new BP_Activity_Activity( $comment );
2261
- }
2262
-
2263
- // Recurse through activity tree to find the depth.
2264
- if ( is_object( $comment ) && isset( $comment->type ) && 'activity_comment' === $comment->type ) {
2265
- // Fetch the entire root comment tree... ugh.
2266
- $comments = BP_Activity_Activity::get_activity_comments( $comment->item_id, 1, constant( 'PHP_INT_MAX' ) );
2267
-
2268
- // Recursively find our comment object from the comment tree.
2269
- $iterator = new RecursiveArrayIterator( $comments );
2270
- $recursive = new RecursiveIteratorIterator( $iterator, RecursiveIteratorIterator::SELF_FIRST );
2271
- foreach ( $recursive as $cid => $cobj ) {
2272
- // Skip items that are not a comment object.
2273
- if ( ! is_numeric( $cid ) || ! is_object( $cobj ) ) {
2274
- continue;
2275
- }
2276
-
2277
- // We found the activity comment! Set the depth.
2278
- if ( $cid === $comment->id && isset( $cobj->depth ) ) {
2279
- $depth = $cobj->depth;
2280
- break;
2281
- }
2282
- }
2283
- }
2284
- }
2285
2286
/**
2287
* Filters the comment depth of the current activity comment.
@@ -2290,7 +2251,7 @@ function bp_activity_comment_depth( $comment = 0 ) {
2290
*
2291
* @param int $depth Depth for the current activity comment.
2292
*/
2293
- return apply_filters( 'bp_activity_get_comment_depth', $depth );
2294
}
2295
2296
/**
@@ -2342,8 +2303,8 @@ function bp_activity_comment_form_nojs_display() {
2342
*
2343
* @global object $activities_template {@link BP_Activity_Template}
2344
*
2345
- * @return string|false The activity comment form no JavaScript
2346
- * display CSS. False on failure.
2347
*/
2348
function bp_get_activity_comment_form_nojs_display() {
2349
global $activities_template;
@@ -2736,7 +2697,7 @@ function bp_activity_latest_update( $user_id = 0 ) {
2736
* @param string $value The excerpt for the latest update.
2737
* @param int $user_id ID of the queried user.
2738
*/
2739
- $latest_update = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], bp_activity_get_excerpt_length() ) ) ), $user_id );
2740
2741
$latest_update = sprintf(
2742
'%s <a href="%s">%s</a>',
@@ -2926,7 +2887,7 @@ function bp_activity_can_comment_reply( $comment = false ) {
2926
// Fall back on current comment in activity loop.
2927
$comment_depth = isset( $comment->depth )
2928
? intval( $comment->depth )
2929
- : bp_activity_get_comment_depth( $comment );
2930
2931
// Threading is turned on, so check the depth.
2932
if ( get_option( 'thread_comments' ) ) {
@@ -3838,15 +3799,45 @@ function bp_activity_show_filters( $context = '' ) {
3838
* @return string HTML for <option> values.
3839
*/
3840
function bp_get_activity_show_filters( $context = '' ) {
3841
- $filters = array();
3842
- $actions = bp_activity_get_actions_for_context( $context );
3843
- foreach ( $actions as $action ) {
3844
- // Friends activity collapses two filters into one.
3845
- if ( in_array( $action['key'], array( 'friendship_accepted', 'friendship_created' ) ) ) {
3846
- $action['key'] = 'friendship_accepted,friendship_created';
3847
}
3848
3849
- $filters[ $action['key'] ] = $action['label'];
3850
}
3851
3852
/**
10
// Exit if accessed directly.
11
defined( 'ABSPATH' ) || exit;
12
13
+ if ( ! buddypress()->do_autoload ) {
14
+ require dirname( __FILE__ ) . '/classes/class-bp-activity-template.php';
15
+ }
16
+
17
/**
18
* Output the activity component slug.
19
*
1390
*
1391
* @since 1.2.0
1392
*
1393
+ * @param array $value Array containing the current activity content body and the current activity.
1394
*/
1395
return apply_filters_ref_array( 'bp_get_activity_content_body', array( $activities_template->activity->content, &$activities_template->activity ) );
1396
}
1496
1497
// Setup variables for activity meta.
1498
$activity_permalink = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity );
1499
+ $activity_meta = sprintf( '%1$s <a href="%2$s" class="view activity-time-since" title="%3$s">%4$s</a>',
1500
$new_content,
1501
$activity_permalink,
1502
esc_attr__( 'View Discussion', 'buddypress' ),
1536
*
1537
* @global object $activities_template {@link BP_Activity_Template}
1538
*
1539
+ * @param BP_Activity_Activity $activity Optional. Falls back on the current item in the loop.
1540
* @return bool True if can delete, false otherwise.
1541
*/
1542
function bp_activity_user_can_delete( $activity = false ) {
2093
* activity comment.
2094
*/
2095
function bp_get_activity_comment_delete_link() {
2096
+ $link = wp_nonce_url( bp_get_activity_directory_permalink() . 'delete/' . bp_get_activity_comment_id() . '?cid=' . bp_get_activity_comment_id(), 'bp_activity_delete_link' );
2097
2098
/**
2099
* Filters the link used for deleting the activity comment currently being displayed.
2230
* Output the depth of the current activity comment.
2231
*
2232
* @since 2.0.0
2233
*/
2234
+ function bp_activity_comment_depth() {
2235
+ echo bp_activity_get_comment_depth();
2236
}
2237
/**
2238
* Return the current activity comment depth.
2239
*
2240
* @since 2.0.0
2241
*
2242
+ * @return int $depth Depth for the current activity comment.
2243
*/
2244
+ function bp_activity_get_comment_depth() {
2245
+ global $activities_template;
2246
2247
/**
2248
* Filters the comment depth of the current activity comment.
2251
*
2252
* @param int $depth Depth for the current activity comment.
2253
*/
2254
+ return apply_filters( 'bp_activity_get_comment_depth', $activities_template->activity->current_comment->depth );
2255
}
2256
2257
/**
2303
*
2304
* @global object $activities_template {@link BP_Activity_Template}
2305
*
2306
+ * @return string|bool The activity comment form no JavaScript
2307
+ * display CSS. False on failure.
2308
*/
2309
function bp_get_activity_comment_form_nojs_display() {
2310
global $activities_template;
2697
* @param string $value The excerpt for the latest update.
2698
* @param int $user_id ID of the queried user.
2699
*/
2700
+ $latest_update = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], 358 ) ) ), $user_id );
2701
2702
$latest_update = sprintf(
2703
'%s <a href="%s">%s</a>',
2887
// Fall back on current comment in activity loop.
2888
$comment_depth = isset( $comment->depth )
2889
? intval( $comment->depth )
2890
+ : bp_activity_get_comment_depth();
2891
2892
// Threading is turned on, so check the depth.
2893
if ( get_option( 'thread_comments' ) ) {
3799
* @return string HTML for <option> values.
3800
*/
3801
function bp_get_activity_show_filters( $context = '' ) {
3802
+ // Set default context based on current page.
3803
+ if ( empty( $context ) ) {
3804
+
3805
+ // On member pages, default to 'member', unless this
3806
+ // is a user's Groups activity.
3807
+ if ( bp_is_user() ) {
3808
+ if ( bp_is_active( 'groups' ) && bp_is_current_action( bp_get_groups_slug() ) ) {
3809
+ $context = 'member_groups';
3810
+ } else {
3811
+ $context = 'member';
3812
+ }
3813
+
3814
+ // On individual group pages, default to 'group'.
3815
+ } elseif ( bp_is_active( 'groups' ) && bp_is_group() ) {
3816
+ $context = 'group';
3817
+
3818
+ // 'activity' everywhere else.
3819
+ } else {
3820
+ $context = 'activity';
3821
}
3822
+ }
3823
+
3824
+ $filters = array();
3825
+
3826
+ // Walk through the registered actions, and prepare an the
3827
+ // select box options.
3828
+ foreach ( bp_activity_get_actions() as $actions ) {
3829
+ foreach ( $actions as $action ) {
3830
+ if ( ! in_array( $context, (array) $action['context'] ) ) {
3831
+ continue;
3832
+ }
3833
3834
+ // Friends activity collapses two filters into one.
3835
+ if ( in_array( $action['key'], array( 'friendship_accepted', 'friendship_created' ) ) ) {
3836
+ $action['key'] = 'friendship_accepted,friendship_created';
3837
+ }
3838
+
3839
+ $filters[ $action['key'] ] = $action['label'];
3840
+ }
3841
}
3842
3843
/**
bp-activity/classes/class-bp-activity-activity.php CHANGED
@@ -185,25 +185,22 @@ class BP_Activity_Activity {
185
wp_cache_set( $this->id, $row, 'bp_activity' );
186
}
187
188
- if ( empty( $row ) ) {
189
- $this->id = 0;
190
- return;
191
- }
192
-
193
- $this->id = (int) $row->id;
194
- $this->item_id = (int) $row->item_id;
195
- $this->secondary_item_id = (int) $row->secondary_item_id;
196
- $this->user_id = (int) $row->user_id;
197
- $this->primary_link = $row->primary_link;
198
- $this->component = $row->component;
199
- $this->type = $row->type;
200
- $this->action = $row->action;
201
- $this->content = $row->content;
202
- $this->date_recorded = $row->date_recorded;
203
- $this->hide_sitewide = (int) $row->hide_sitewide;
204
- $this->mptt_left = (int) $row->mptt_left;
205
- $this->mptt_right = (int) $row->mptt_right;
206
- $this->is_spam = (int) $row->is_spam;
207
208
// Generate dynamic 'action' when possible.
209
$action = bp_activity_generate_action_string( $this );
@@ -226,7 +223,7 @@ class BP_Activity_Activity {
226
*
227
* @since 1.0.0
228
*
229
- * @return WP_Error|bool True on success.
230
*/
231
public function save() {
232
global $wpdb;
@@ -320,7 +317,6 @@ class BP_Activity_Activity {
320
*
321
* @since 1.2.0
322
* @since 2.4.0 Introduced the `$fields` parameter.
323
- * @since 2.9.0 Introduced the `$order_by` parameter.
324
*
325
* @see BP_Activity_Activity::get_filter_sql() for a description of the
326
* 'filter' parameter.
@@ -336,7 +332,6 @@ class BP_Activity_Activity {
336
* @type string $fields Activity fields to return. Pass 'ids' to get only the activity IDs.
337
* 'all' returns full activity objects.
338
* @type string $sort ASC or DESC. Default: 'DESC'.
339
- * @type string $order_by Column to order results by.
340
* @type array $exclude Array of activity IDs to exclude. Default: false.
341
* @type array $in Array of ids to limit query by (IN). Default: false.
342
* @type array $meta_query Array of meta_query conditions. See WP_Meta_Query::queries.
@@ -378,30 +373,30 @@ class BP_Activity_Activity {
378
10 => 'spam'
379
);
380
381
- $args = bp_core_parse_args_array( $old_args_keys, func_get_args() );
382
}
383
384
$bp = buddypress();
385
$r = wp_parse_args( $args, array(
386
- 'page' => 1, // The current page.
387
- 'per_page' => 25, // Activity items per page.
388
- 'max' => false, // Max number of items to return.
389
- 'fields' => 'all', // Fields to include.
390
- 'sort' => 'DESC', // ASC or DESC.
391
- 'order_by' => 'date_recorded', // Column to order by.
392
- 'exclude' => false, // Array of ids to exclude.
393
- 'in' => false, // Array of ids to limit query by (IN).
394
- 'meta_query' => false, // Filter by activitymeta.
395
- 'date_query' => false, // Filter by date.
396
- 'filter_query' => false, // Advanced filtering - see BP_Activity_Query.
397
- 'filter' => false, // See self::get_filter_sql().
398
- 'scope' => false, // Preset activity arguments.
399
- 'search_terms' => false, // Terms to search by.
400
- 'display_comments' => false, // Whether to include activity comments.
401
- 'show_hidden' => false, // Show items marked hide_sitewide.
402
- 'spam' => 'ham_only', // Spam status.
403
- 'update_meta_cache' => true, // Whether or not to update meta cache.
404
- 'count_total' => false, // Whether or not to use count_total.
405
) );
406
407
// Select conditions.
@@ -428,7 +423,7 @@ class BP_Activity_Activity {
428
429
// Override some arguments if needed.
430
if ( ! empty( $scope_query['override'] ) ) {
431
- $r = array_replace_recursive( $r, $scope_query['override'] );
432
}
433
434
// Advanced filtering.
@@ -464,29 +459,6 @@ class BP_Activity_Activity {
464
$sort = 'DESC';
465
}
466
467
- switch( $r['order_by'] ) {
468
- case 'id' :
469
- case 'user_id' :
470
- case 'component' :
471
- case 'type' :
472
- case 'action' :
473
- case 'content' :
474
- case 'primary_link' :
475
- case 'item_id' :
476
- case 'secondary_item_id' :
477
- case 'date_recorded' :
478
- case 'hide_sitewide' :
479
- case 'mptt_left' :
480
- case 'mptt_right' :
481
- case 'is_spam' :
482
- break;
483
-
484
- default :
485
- $r['order_by'] = 'date_recorded';
486
- break;
487
- }
488
- $order_by = 'a.' . $r['order_by'];
489
-
490
// Hide Hidden Items?
491
if ( ! $r['show_hidden'] ) {
492
$where_conditions['hidden_sql'] = "a.hide_sitewide = 0";
@@ -570,6 +542,28 @@ class BP_Activity_Activity {
570
*/
571
$join_sql = apply_filters( 'bp_activity_get_join_sql', $join_sql, $r, $select_sql, $from_sql, $where_sql );
572
573
// Sanitize page and per_page parameters.
574
$page = absint( $r['page'] );
575
$per_page = absint( $r['per_page'] );
@@ -633,7 +627,7 @@ class BP_Activity_Activity {
633
634
} else {
635
// Query first for activity IDs.
636
- $activity_ids_sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY {$order_by} {$sort}, a.id {$sort}";
637
638
if ( ! empty( $per_page ) && ! empty( $page ) ) {
639
// We query for $per_page + 1 items in order to
@@ -987,7 +981,7 @@ class BP_Activity_Activity {
987
* @param mixed $scope The activity scope. Accepts string or array of scopes.
988
* @param array $r Current activity arguments. Same as those of BP_Activity_Activity::get(),
989
* but merged with defaults.
990
- * @return false|array 'sql' WHERE SQL string and 'override' activity args.
991
*/
992
public static function get_scope_query_sql( $scope = false, $r = array() ) {
993
@@ -1116,7 +1110,7 @@ class BP_Activity_Activity {
1116
* @param string $action Action to filter by.
1117
* @param string $content Content to filter by.
1118
* @param string $date_recorded Date to filter by.
1119
- * @return int|false Activity ID on success, false if none is found.
1120
*/
1121
public static function get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content, $date_recorded ) {
1122
global $wpdb;
@@ -1477,6 +1471,7 @@ class BP_Activity_Activity {
1477
}
1478
1479
// Legacy query - not recommended.
1480
1481
/**
1482
* Filters if BuddyPress should use the legacy activity query.
@@ -1487,7 +1482,7 @@ class BP_Activity_Activity {
1487
* @param BP_Activity_Activity $value Magic method referring to currently called method.
1488
* @param array $func_args Array of the method's argument list.
1489
*/
1490
- if ( apply_filters( 'bp_use_legacy_activity_query', false, __METHOD__, func_get_args() ) ) {
1491
1492
/**
1493
* Filters the MySQL prepared statement for the legacy activity query.
@@ -1697,7 +1692,7 @@ class BP_Activity_Activity {
1697
*
1698
* @param string $field The database field.
1699
* @param array|bool $items The values for the IN clause, or false when none are found.
1700
- * @return string|false
1701
*/
1702
public static function get_in_operator_sql( $field, $items ) {
1703
global $wpdb;
@@ -1845,7 +1840,7 @@ class BP_Activity_Activity {
1845
* @since 1.1.0
1846
*
1847
* @param string $content The content to filter by.
1848
- * @return int|false The ID of the first matching item if found, otherwise false.
1849
*/
1850
public static function check_exists_by_content( $content ) {
1851
global $wpdb;
@@ -1872,4 +1867,57 @@ class BP_Activity_Activity {
1872
1873
return $wpdb->get_var( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET hide_sitewide = 1 WHERE user_id = %d", $user_id ) );
1874
}
1875
}
185
wp_cache_set( $this->id, $row, 'bp_activity' );
186
}
187
188
+ if ( ! empty( $row ) ) {
189
+ $this->id = (int) $row->id;
190
+ $this->item_id = (int) $row->item_id;
191
+ $this->secondary_item_id = (int) $row->secondary_item_id;
192
+ $this->user_id = (int) $row->user_id;
193
+ $this->primary_link = $row->primary_link;
194
+ $this->component = $row->component;
195
+ $this->type = $row->type;
196
+ $this->action = $row->action;
197
+ $this->content = $row->content;
198
+ $this->date_recorded = $row->date_recorded;
199
+ $this->hide_sitewide = (int) $row->hide_sitewide;
200
+ $this->mptt_left = (int) $row->mptt_left;
201
+ $this->mptt_right = (int) $row->mptt_right;
202
+ $this->is_spam = (int) $row->is_spam;
203
+ }
204
205
// Generate dynamic 'action' when possible.
206
$action = bp_activity_generate_action_string( $this );
223
*
224
* @since 1.0.0
225
*
226
+ * @return bool True on success.
227
*/
228
public function save() {
229
global $wpdb;
317
*
318
* @since 1.2.0
319
* @since 2.4.0 Introduced the `$fields` parameter.
320
*
321
* @see BP_Activity_Activity::get_filter_sql() for a description of the
322
* 'filter' parameter.
332
* @type string $fields Activity fields to return. Pass 'ids' to get only the activity IDs.
333
* 'all' returns full activity objects.
334
* @type string $sort ASC or DESC. Default: 'DESC'.
335
* @type array $exclude Array of activity IDs to exclude. Default: false.
336
* @type array $in Array of ids to limit query by (IN). Default: false.
337
* @type array $meta_query Array of meta_query conditions. See WP_Meta_Query::queries.
373
10 => 'spam'
374
);
375
376
+ $func_args = func_get_args();
377
+ $args = bp_core_parse_args_array( $old_args_keys, $func_args );
378
}
379
380
$bp = buddypress();
381
$r = wp_parse_args( $args, array(
382
+ 'page' => 1, // The current page.
383
+ 'per_page' => 25, // Activity items per page.
384
+ 'max' => false, // Max number of items to return.
385
+ 'fields' => 'all', // Fields to include.
386
+ 'sort' => 'DESC', // ASC or DESC.
387
+ 'exclude' => false, // Array of ids to exclude.
388
+ 'in' => false, // Array of ids to limit query by (IN).
389
+ 'meta_query' => false, // Filter by activitymeta.
390
+ 'date_query' => false, // Filter by date.
391
+ 'filter_query' => false, // Advanced filtering - see BP_Activity_Query.
392
+ 'filter' => false, // See self::get_filter_sql().
393
+ 'scope' => false, // Preset activity arguments.
394
+ 'search_terms' => false, // Terms to search by.
395
+ 'display_comments' => false, // Whether to include activity comments.
396
+ 'show_hidden' => false, // Show items marked hide_sitewide.
397
+ 'spam' => 'ham_only', // Spam status.
398
+ 'update_meta_cache' => true, // Whether or not to update meta cache.
399
+ 'count_total' => false, // Whether or not to use count_total.
400
) );
401
402
// Select conditions.
423
424
// Override some arguments if needed.
425
if ( ! empty( $scope_query['override'] ) ) {
426
+ $r = self::array_replace_recursive( $r, $scope_query['override'] );
427
}
428
429
// Advanced filtering.
459
$sort = 'DESC';
460
}
461
462
// Hide Hidden Items?
463
if ( ! $r['show_hidden'] ) {
464
$where_conditions['hidden_sql'] = "a.hide_sitewide = 0";
542
*/
543
$join_sql = apply_filters( 'bp_activity_get_join_sql', $join_sql, $r, $select_sql, $from_sql, $where_sql );
544
545
+ /**
546
+ * Filters the preferred order of indexes for activity item.
547
+ *
548
+ * @since 1.6.0
549
+ *
550
+ * @param array $value Array of indexes in preferred order.
551
+ */
552
+ $indexes = apply_filters( 'bp_activity_preferred_index_order', array( 'user_id', 'item_id', 'secondary_item_id', 'date_recorded', 'component', 'type', 'hide_sitewide', 'is_spam' ) );
553
+
554
+ foreach( $indexes as $key => $index ) {
555
+ if ( false !== strpos( $where_sql, $index ) ) {
556
+ $the_index = $index;
557
+ break; // Take the first one we find.
558
+ }
559
+ }
560
+
561
+ if ( !empty( $the_index ) ) {
562
+ $index_hint_sql = "USE INDEX ({$the_index})";
563
+ } else {
564
+ $index_hint_sql = '';
565
+ }
566
+
567
// Sanitize page and per_page parameters.
568
$page = absint( $r['page'] );
569
$per_page = absint( $r['per_page'] );
627
628
} else {
629
// Query first for activity IDs.
630
+ $activity_ids_sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}, a.id {$sort}";
631
632
if ( ! empty( $per_page ) && ! empty( $page ) ) {
633
// We query for $per_page + 1 items in order to
981
* @param mixed $scope The activity scope. Accepts string or array of scopes.
982
* @param array $r Current activity arguments. Same as those of BP_Activity_Activity::get(),
983
* but merged with defaults.
984
+ * @return array 'sql' WHERE SQL string and 'override' activity args.
985
*/
986
public static function get_scope_query_sql( $scope = false, $r = array() ) {
987
1110
* @param string $action Action to filter by.
1111
* @param string $content Content to filter by.
1112
* @param string $date_recorded Date to filter by.
1113
+ * @return int|bool Activity ID on success, false if none is found.
1114
*/
1115
public static function get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content, $date_recorded ) {
1116
global $wpdb;
1471
}
1472
1473
// Legacy query - not recommended.
1474
+ $func_args = func_get_args();
1475
1476
/**
1477
* Filters if BuddyPress should use the legacy activity query.
1482
* @param BP_Activity_Activity $value Magic method referring to currently called method.
1483
* @param array $func_args Array of the method's argument list.
1484
*/
1485
+ if ( apply_filters( 'bp_use_legacy_activity_query', false, __METHOD__, $func_args ) ) {
1486
1487
/**
1488
* Filters the MySQL prepared statement for the legacy activity query.
1692
*
1693
* @param string $field The database field.
1694
* @param array|bool $items The values for the IN clause, or false when none are found.
1695
+ * @return string|bool
1696
*/
1697
public static function get_in_operator_sql( $field, $items ) {
1698
global $wpdb;
1840
* @since 1.1.0
1841
*
1842
* @param string $content The content to filter by.
1843
+ * @return int|bool The ID of the first matching item if found, otherwise false.
1844
*/
1845
public static function check_exists_by_content( $content ) {
1846
global $wpdb;
1867
1868
return $wpdb->get_var( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET hide_sitewide = 1 WHERE user_id = %d", $user_id ) );
1869
}
1870
+
1871
+ /**
1872
+ * PHP-agnostic version of {@link array_replace_recursive()}.
1873
+ *
1874
+ * The array_replace_recursive() function is a PHP 5.3 function. BuddyPress (and
1875
+ * WordPress) currently supports down to PHP 5.2, so this method is a workaround
1876
+ * for PHP 5.2.
1877
+ *
1878
+ * Note: array_replace_recursive() supports infinite arguments, but for our use-
1879
+ * case, we only need to support two arguments.
1880
+ *
1881
+ * Subject to removal once WordPress makes PHP 5.3.0 the minimum requirement.
1882
+ *
1883
+ * @since 2.2.0
1884
+ *
1885
+ * @see http://php.net/manual/en/function.array-replace-recursive.php#109390
1886
+ *
1887
+ * @param array $base Array with keys needing to be replaced.
1888
+ * @param array $replacements Array with the replaced keys.
1889
+ * @return array
1890
+ */
1891
+ protected static function array_replace_recursive( $base = array(), $replacements = array() ) {
1892
+ if ( function_exists( 'array_replace_recursive' ) ) {
1893
+ return array_replace_recursive( $base, $replacements );
1894
+ }
1895
+
1896
+ // PHP 5.2-compatible version
1897
+ // http://php.net/manual/en/function.array-replace-recursive.php#109390.
1898
+ foreach ( array_slice( func_get_args(), 1 ) as $replacements ) {
1899
+ $bref_stack = array( &$base );
1900
+ $head_stack = array( $replacements );
1901
+
1902
+ do {
1903
+ end( $bref_stack );
1904
+
1905
+ $bref = &$bref_stack[ key( $bref_stack ) ];
1906
+ $head = array_pop( $head_stack );
1907
+
1908
+ unset( $bref_stack[ key($bref_stack) ] );
1909
+
1910
+ foreach ( array_keys( $head ) as $key ) {
1911
+ if ( isset( $key, $bref ) && is_array( $bref[$key] ) && is_array( $head[$key] ) ) {
1912
+ $bref_stack[] = &$bref[ $key ];
1913
+ $head_stack[] = $head[ $key ];
1914
+ } else {
1915
+ $bref[ $key ] = $head[ $key ];
1916
+ }
1917
+ }
1918
+ } while( count( $head_stack ) );
1919
+ }
1920
+
1921
+ return $base;
1922
+ }
1923
}
bp-activity/classes/class-bp-activity-component.php CHANGED
@@ -65,6 +65,10 @@ class BP_Activity_Component extends BP_Component {
65
$includes[] = 'notifications';
66
}
67
68
// Load Akismet support if Akismet is configured.
69
$akismet_key = bp_get_option( 'wordpress_api_key' );
70