BuddyPress - Version 2.5.4

Version Description

See: https://codex.buddypress.org/releases/version-2-5-4/

Download this release

Release Info

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

Code changes from version 2.7.4 to 2.5.4

Files changed (612) hide show
  1. bp-activity/admin/js/admin.min.js +1 -0
  2. bp-activity/bp-activity-actions.php +142 -1
  3. bp-activity/bp-activity-admin.php +10 -40
  4. bp-activity/bp-activity-adminbar.php +0 -47
  5. bp-activity/bp-activity-akismet.php +1 -26
  6. bp-activity/bp-activity-cache.php +0 -21
  7. bp-activity/bp-activity-classes.php +0 -5
  8. bp-activity/bp-activity-embeds.php +0 -352
  9. bp-activity/bp-activity-filters.php +42 -54
  10. bp-activity/bp-activity-functions.php +213 -342
  11. bp-activity/bp-activity-loader.php +2 -4
  12. bp-activity/bp-activity-notifications.php +237 -184
  13. bp-activity/bp-activity-screens.php +64 -26
  14. bp-activity/bp-activity-template.php +289 -41
  15. bp-activity/classes/class-bp-activity-activity.php +10 -96
  16. bp-activity/classes/class-bp-activity-component.php +32 -27
  17. bp-activity/classes/class-bp-activity-list-table.php +9 -37
  18. bp-activity/classes/class-bp-activity-oembed-extension.php +0 -329
  19. bp-activity/css/mentions-rtl.css +3 -2
  20. bp-activity/css/mentions-rtl.min.css +1 -1
  21. bp-activity/css/mentions.css +3 -3
  22. bp-activity/css/mentions.min.css +1 -1
  23. bp-activity/js/mentions.js +1 -1
  24. bp-activity/js/mentions.min.js +2 -1
  25. bp-blogs/bp-blogs-activity.php +2 -136
  26. bp-blogs/bp-blogs-filters.php +1 -14
  27. bp-blogs/bp-blogs-functions.php +161 -150
  28. bp-blogs/bp-blogs-loader.php +1 -5
  29. bp-blogs/bp-blogs-screens.php +1 -3
  30. bp-blogs/bp-blogs-template.php +44 -131
  31. bp-blogs/bp-blogs-widgets.php +1 -3
  32. bp-blogs/classes/class-bp-blogs-blog.php +10 -33
  33. bp-blogs/classes/class-bp-blogs-component.php +3 -19
  34. bp-blogs/classes/class-bp-blogs-recent-posts-widget.php +2 -3
  35. bp-core/admin/bp-core-admin-actions.php +9 -0
  36. bp-core/admin/bp-core-admin-components.php +94 -28
  37. bp-core/admin/bp-core-admin-functions.php +18 -259
  38. bp-core/admin/bp-core-admin-schema.php +48 -13
  39. bp-core/admin/bp-core-admin-settings.php +16 -0
  40. bp-core/admin/bp-core-admin-slugs.php +4 -11
  41. bp-core/admin/bp-core-admin-tools.php +22 -37
  42. bp-core/admin/css/common-rtl.css +80 -345
  43. bp-core/admin/css/common-rtl.min.css +1 -1
  44. bp-core/admin/css/common.css +80 -345
  45. bp-core/admin/css/common.min.css +1 -1
  46. bp-core/admin/images/autolink-feature.png +0 -0
  47. bp-core/admin/images/bp-emails-feature.png +0 -0
  48. bp-core/admin/images/emoji-feature.png +0 -0
  49. bp-core/admin/images/post-type.png +0 -0
  50. bp-core/admin/images/twentytwelve.png +0 -0
  51. bp-core/admin/js/customizer-controls.min.js +1 -0
  52. bp-core/admin/js/customizer-receiver-emails.min.js +1 -0
  53. bp-core/admin/js/dismissible-admin-notices.js +0 -16
  54. bp-core/admin/js/dismissible-admin-notices.min.js +0 -1
  55. bp-core/bp-core-actions.php +4 -13
  56. bp-core/bp-core-admin.php +21 -30
  57. bp-core/bp-core-adminbar.php +11 -0
  58. bp-core/bp-core-attachments.php +7 -9
  59. bp-core/bp-core-avatars.php +59 -81
  60. bp-core/bp-core-buddybar.php +161 -229
  61. bp-core/bp-core-cache.php +0 -107
  62. bp-core/bp-core-caps.php +37 -65
  63. bp-core/bp-core-catchuri.php +24 -139
  64. bp-core/bp-core-classes.php +0 -9
  65. bp-core/bp-core-component.php +1 -3
  66. bp-core/bp-core-cssjs.php +22 -145
  67. bp-core/bp-core-customizer-email.php +9 -9
  68. bp-core/bp-core-dependency.php +44 -38
  69. bp-core/bp-core-filters.php +49 -53
  70. bp-core/bp-core-functions.php +114 -567
  71. bp-core/bp-core-loader.php +4 -5
  72. bp-core/bp-core-moderation.php +27 -28
  73. bp-core/bp-core-options.php +101 -21
  74. bp-core/bp-core-taxonomy.php +19 -165
  75. bp-core/bp-core-template-loader.php +15 -63
  76. bp-core/bp-core-template.php +114 -221
  77. bp-core/bp-core-theme-compatibility.php +40 -18
  78. bp-core/bp-core-update.php +42 -109
  79. bp-core/bp-core-widgets.php +1 -3
  80. bp-core/bp-core-wpabstraction.php +7 -0
  81. bp-core/classes/class-bp-admin.php +96 -221
  82. bp-core/classes/class-bp-attachment-avatar.php +21 -1
  83. bp-core/classes/class-bp-attachment.php +26 -12
  84. bp-core/classes/class-bp-button.php +76 -231
  85. bp-core/classes/class-bp-component.php +16 -2
  86. bp-core/classes/class-bp-core-bp-nav-backcompat.php +0 -270
  87. bp-core/classes/class-bp-core-bp-options-nav-backcompat.php +0 -138
  88. bp-core/classes/class-bp-core-html-element.php +0 -127
  89. bp-core/classes/class-bp-core-login-widget.php +2 -3
  90. bp-core/classes/class-bp-core-nav-item.php +0 -34
  91. bp-core/classes/class-bp-core-nav.php +0 -402
  92. bp-core/classes/class-bp-core-oembed-extension.php +0 -622
  93. bp-core/classes/class-bp-core-user.php +13 -18
  94. bp-core/classes/class-bp-core.php +1 -6
  95. bp-core/classes/class-bp-email-recipient.php +13 -36
  96. bp-core/classes/class-bp-embed.php +9 -0
  97. bp-core/classes/class-bp-theme-compat.php +1 -1
  98. bp-core/classes/class-bp-user-query.php +9 -17
  99. bp-core/classes/class-bp-walker-category-checklist.php +1 -1
  100. bp-core/css/admin-bar-rtl.css +0 -13
  101. bp-core/css/admin-bar-rtl.min.css +1 -1
  102. bp-core/css/admin-bar.css +0 -13
  103. bp-core/css/admin-bar.min.css +1 -1
  104. bp-core/css/avatar-rtl.css +2 -16
  105. bp-core/css/avatar-rtl.min.css +1 -1
  106. bp-core/css/avatar.css +2 -16
  107. bp-core/css/avatar.min.css +1 -1
  108. bp-core/css/buddybar-rtl.css +3 -3
  109. bp-core/css/buddybar-rtl.min.css +1 -1
  110. bp-core/deprecated/1.2.php +2 -0
  111. bp-core/deprecated/1.7.php +1 -0
  112. bp-core/deprecated/2.6.php +0 -50
  113. bp-core/deprecated/2.7.php +0 -26
  114. bp-core/images/mystery-group-50.png +0 -0
  115. bp-core/images/mystery-group.png +0 -0
  116. bp-core/js/avatar.min.js +1 -0
  117. bp-core/js/bp-plupload.min.js +2 -1
  118. bp-core/js/confirm.min.js +2 -1
  119. bp-core/js/cover-image.min.js +1 -0
  120. bp-core/js/{vendor/jquery-cookie.js → jquery-cookie.js} +0 -0
  121. bp-core/js/{vendor/jquery-cookie.min.js → jquery-cookie.min.js} +2 -1
  122. bp-core/js/jquery-query.min.js +1 -0
  123. bp-core/js/{vendor/jquery-scroll-to.js → jquery-scroll-to.js} +0 -0
  124. bp-core/js/{vendor/jquery-scroll-to.min.js → jquery-scroll-to.min.js} +2 -1
  125. bp-core/js/{vendor/jquery.atwho.js → jquery.atwho.js} +0 -0
  126. bp-core/js/jquery.atwho.min.js +2 -0
  127. bp-core/js/{vendor/jquery.atwho.txt → jquery.atwho.txt} +0 -0
  128. bp-core/js/{vendor/jquery.caret.js → jquery.caret.js} +0 -0
  129. bp-core/js/{vendor/jquery.caret.min.js → jquery.caret.min.js} +2 -1
  130. bp-core/js/{vendor/jquery.caret.txt → jquery.caret.txt} +0 -0
  131. bp-core/js/vendor/jquery.atwho.min.js +0 -1
  132. bp-core/js/vendor/livestamp.js +0 -129
  133. bp-core/js/vendor/livestamp.min.js +0 -1
  134. bp-core/js/vendor/moment-js/locale/af.js +0 -73
  135. bp-core/js/vendor/moment-js/locale/af.min.js +0 -1
  136. bp-core/js/vendor/moment-js/locale/ar-ly.js +0 -122
  137. bp-core/js/vendor/moment-js/locale/ar-ly.min.js +0 -1
  138. bp-core/js/vendor/moment-js/locale/ar-ma.js +0 -60
  139. bp-core/js/vendor/moment-js/locale/ar-ma.min.js +0 -1
  140. bp-core/js/vendor/moment-js/locale/ar-sa.js +0 -104
  141. bp-core/js/vendor/moment-js/locale/ar-sa.min.js +0 -1
  142. bp-core/js/vendor/moment-js/locale/ar-tn.js +0 -59
  143. bp-core/js/vendor/moment-js/locale/ar-tn.min.js +0 -1
  144. bp-core/js/vendor/moment-js/locale/ar.js +0 -137
  145. bp-core/js/vendor/moment-js/locale/ar.min.js +0 -1
  146. bp-core/js/vendor/moment-js/locale/az.js +0 -105
  147. bp-core/js/vendor/moment-js/locale/az.min.js +0 -1
  148. bp-core/js/vendor/moment-js/locale/be.js +0 -134
  149. bp-core/js/vendor/moment-js/locale/be.min.js +0 -1
  150. bp-core/js/vendor/moment-js/locale/bg.js +0 -90
  151. bp-core/js/vendor/moment-js/locale/bg.min.js +0 -1
  152. bp-core/js/vendor/moment-js/locale/bn.js +0 -119
  153. bp-core/js/vendor/moment-js/locale/bn.min.js +0 -1
  154. bp-core/js/vendor/moment-js/locale/bo.js +0 -119
  155. bp-core/js/vendor/moment-js/locale/bo.min.js +0 -1
  156. bp-core/js/vendor/moment-js/locale/br.js +0 -108
  157. bp-core/js/vendor/moment-js/locale/br.min.js +0 -1
  158. bp-core/js/vendor/moment-js/locale/bs.js +0 -143
  159. bp-core/js/vendor/moment-js/locale/bs.min.js +0 -1
  160. bp-core/js/vendor/moment-js/locale/ca.js +0 -81
  161. bp-core/js/vendor/moment-js/locale/ca.min.js +0 -1
  162. bp-core/js/vendor/moment-js/locale/cs.js +0 -172
  163. bp-core/js/vendor/moment-js/locale/cs.min.js +0 -1
  164. bp-core/js/vendor/moment-js/locale/cv.js +0 -63
  165. bp-core/js/vendor/moment-js/locale/cv.min.js +0 -1
  166. bp-core/js/vendor/moment-js/locale/cy.js +0 -81
  167. bp-core/js/vendor/moment-js/locale/cy.min.js +0 -1
  168. bp-core/js/vendor/moment-js/locale/da.js +0 -60
  169. bp-core/js/vendor/moment-js/locale/da.min.js +0 -1
  170. bp-core/js/vendor/moment-js/locale/de-at.js +0 -79
  171. bp-core/js/vendor/moment-js/locale/de-at.min.js +0 -1
  172. bp-core/js/vendor/moment-js/locale/de.js +0 -78
  173. bp-core/js/vendor/moment-js/locale/de.min.js +0 -1
  174. bp-core/js/vendor/moment-js/locale/dv.js +0 -99
  175. bp-core/js/vendor/moment-js/locale/dv.min.js +0 -1
  176. bp-core/js/vendor/moment-js/locale/el.js +0 -98
  177. bp-core/js/vendor/moment-js/locale/el.min.js +0 -1
  178. bp-core/js/vendor/moment-js/locale/en-au.js +0 -67
  179. bp-core/js/vendor/moment-js/locale/en-au.min.js +0 -1
  180. bp-core/js/vendor/moment-js/locale/en-ca.js +0 -63
  181. bp-core/js/vendor/moment-js/locale/en-ca.min.js +0 -1
  182. bp-core/js/vendor/moment-js/locale/en-gb.js +0 -67
  183. bp-core/js/vendor/moment-js/locale/en-gb.min.js +0 -1
  184. bp-core/js/vendor/moment-js/locale/en-ie.js +0 -67
  185. bp-core/js/vendor/moment-js/locale/en-ie.min.js +0 -1
  186. bp-core/js/vendor/moment-js/locale/en-nz.js +0 -67
  187. bp-core/js/vendor/moment-js/locale/en-nz.min.js +0 -1
  188. bp-core/js/vendor/moment-js/locale/eo.js +0 -73
  189. bp-core/js/vendor/moment-js/locale/eo.min.js +0 -1
  190. bp-core/js/vendor/moment-js/locale/es-do.js +0 -80
  191. bp-core/js/vendor/moment-js/locale/es-do.min.js +0 -1
  192. bp-core/js/vendor/moment-js/locale/es.js +0 -81
  193. bp-core/js/vendor/moment-js/locale/es.min.js +0 -1
  194. bp-core/js/vendor/moment-js/locale/et.js +0 -80
  195. bp-core/js/vendor/moment-js/locale/et.min.js +0 -1
  196. bp-core/js/vendor/moment-js/locale/eu.js +0 -66
  197. bp-core/js/vendor/moment-js/locale/eu.min.js +0 -1
  198. bp-core/js/vendor/moment-js/locale/fa.js +0 -106
  199. bp-core/js/vendor/moment-js/locale/fa.min.js +0 -1
  200. bp-core/js/vendor/moment-js/locale/fi.js +0 -107
  201. bp-core/js/vendor/moment-js/locale/fi.min.js +0 -1
  202. bp-core/js/vendor/moment-js/locale/fo.js +0 -60
  203. bp-core/js/vendor/moment-js/locale/fo.min.js +0 -1
  204. bp-core/js/vendor/moment-js/locale/fr-ca.js +0 -60
  205. bp-core/js/vendor/moment-js/locale/fr-ca.min.js +0 -1
  206. bp-core/js/vendor/moment-js/locale/fr-ch.js +0 -64
  207. bp-core/js/vendor/moment-js/locale/fr-ch.min.js +0 -1
  208. bp-core/js/vendor/moment-js/locale/fr.js +0 -64
  209. bp-core/js/vendor/moment-js/locale/fr.min.js +0 -1
  210. bp-core/js/vendor/moment-js/locale/fy.js +0 -73
  211. bp-core/js/vendor/moment-js/locale/fy.min.js +0 -1
  212. bp-core/js/vendor/moment-js/locale/gd.js +0 -76
  213. bp-core/js/vendor/moment-js/locale/gd.min.js +0 -1
  214. bp-core/js/vendor/moment-js/locale/gl.js +0 -77
  215. bp-core/js/vendor/moment-js/locale/gl.min.js +0 -1
  216. bp-core/js/vendor/moment-js/locale/he.js +0 -99
  217. bp-core/js/vendor/moment-js/locale/he.min.js +0 -1
  218. bp-core/js/vendor/moment-js/locale/hi.js +0 -124
  219. bp-core/js/vendor/moment-js/locale/hi.min.js +0 -1
  220. bp-core/js/vendor/moment-js/locale/hr.js +0 -145
  221. bp-core/js/vendor/moment-js/locale/hr.min.js +0 -1
  222. bp-core/js/vendor/moment-js/locale/hu.js +0 -109
  223. bp-core/js/vendor/moment-js/locale/hu.min.js +0 -1
  224. bp-core/js/vendor/moment-js/locale/hy-am.js +0 -95
  225. bp-core/js/vendor/moment-js/locale/hy-am.min.js +0 -1
  226. bp-core/js/vendor/moment-js/locale/id.js +0 -83
  227. bp-core/js/vendor/moment-js/locale/id.min.js +0 -1
  228. bp-core/js/vendor/moment-js/locale/is.js +0 -127
  229. bp-core/js/vendor/moment-js/locale/is.min.js +0 -1
  230. bp-core/js/vendor/moment-js/locale/it.js +0 -70
  231. bp-core/js/vendor/moment-js/locale/it.min.js +0 -1
  232. bp-core/js/vendor/moment-js/locale/ja.js +0 -76
  233. bp-core/js/vendor/moment-js/locale/ja.min.js +0 -1
  234. bp-core/js/vendor/moment-js/locale/jv.js +0 -83
  235. bp-core/js/vendor/moment-js/locale/jv.min.js +0 -1
  236. bp-core/js/vendor/moment-js/locale/ka.js +0 -89
  237. bp-core/js/vendor/moment-js/locale/ka.min.js +0 -1
  238. bp-core/js/vendor/moment-js/locale/kk.js +0 -87
  239. bp-core/js/vendor/moment-js/locale/kk.min.js +0 -1
  240. bp-core/js/vendor/moment-js/locale/km.js +0 -58
  241. bp-core/js/vendor/moment-js/locale/km.min.js +0 -1
  242. bp-core/js/vendor/moment-js/locale/ko.js +0 -65
  243. bp-core/js/vendor/moment-js/locale/ko.min.js +0 -1
  244. bp-core/js/vendor/moment-js/locale/ky.js +0 -88
  245. bp-core/js/vendor/moment-js/locale/ky.min.js +0 -1
  246. bp-core/js/vendor/moment-js/locale/lb.js +0 -137
  247. bp-core/js/vendor/moment-js/locale/lb.min.js +0 -1
  248. bp-core/js/vendor/moment-js/locale/lo.js +0 -70
  249. bp-core/js/vendor/moment-js/locale/lo.min.js +0 -1
  250. bp-core/js/vendor/moment-js/locale/lt.js +0 -117
  251. bp-core/js/vendor/moment-js/locale/lt.min.js +0 -1
  252. bp-core/js/vendor/moment-js/locale/lv.js +0 -97
  253. bp-core/js/vendor/moment-js/locale/lv.min.js +0 -1
  254. bp-core/js/vendor/moment-js/locale/me.js +0 -111
  255. bp-core/js/vendor/moment-js/locale/me.min.js +0 -1
  256. bp-core/js/vendor/moment-js/locale/mi.js +0 -64
  257. bp-core/js/vendor/moment-js/locale/mi.min.js +0 -1
  258. bp-core/js/vendor/moment-js/locale/mk.js +0 -90
  259. bp-core/js/vendor/moment-js/locale/mk.min.js +0 -1
  260. bp-core/js/vendor/moment-js/locale/ml.js +0 -81
  261. bp-core/js/vendor/moment-js/locale/ml.min.js +0 -1
  262. bp-core/js/vendor/moment-js/locale/mr.js +0 -159
  263. bp-core/js/vendor/moment-js/locale/mr.min.js +0 -1
  264. bp-core/js/vendor/moment-js/locale/ms-my.js +0 -83
  265. bp-core/js/vendor/moment-js/locale/ms-my.min.js +0 -1
  266. bp-core/js/vendor/moment-js/locale/ms.js +0 -82
  267. bp-core/js/vendor/moment-js/locale/ms.min.js +0 -1
  268. bp-core/js/vendor/moment-js/locale/my.js +0 -95
  269. bp-core/js/vendor/moment-js/locale/my.min.js +0 -1
  270. bp-core/js/vendor/moment-js/locale/nb.js +0 -63
  271. bp-core/js/vendor/moment-js/locale/nb.min.js +0 -1
  272. bp-core/js/vendor/moment-js/locale/ne.js +0 -123
  273. bp-core/js/vendor/moment-js/locale/ne.min.js +0 -1
  274. bp-core/js/vendor/moment-js/locale/nl.js +0 -86
  275. bp-core/js/vendor/moment-js/locale/nl.min.js +0 -1
  276. bp-core/js/vendor/moment-js/locale/nn.js +0 -60
  277. bp-core/js/vendor/moment-js/locale/nn.min.js +0 -1
  278. bp-core/js/vendor/moment-js/locale/pa-in.js +0 -124
  279. bp-core/js/vendor/moment-js/locale/pa-in.min.js +0 -1
  280. bp-core/js/vendor/moment-js/locale/pl.js +0 -105
  281. bp-core/js/vendor/moment-js/locale/pl.min.js +0 -1
  282. bp-core/js/vendor/moment-js/locale/pt-br.js +0 -61
  283. bp-core/js/vendor/moment-js/locale/pt-br.min.js +0 -1
  284. bp-core/js/vendor/moment-js/locale/pt.js +0 -65
  285. bp-core/js/vendor/moment-js/locale/pt.min.js +0 -1
  286. bp-core/js/vendor/moment-js/locale/ro.js +0 -75
  287. bp-core/js/vendor/moment-js/locale/ro.min.js +0 -1
  288. bp-core/js/vendor/moment-js/locale/ru.js +0 -183
  289. bp-core/js/vendor/moment-js/locale/ru.min.js +0 -1
  290. bp-core/js/vendor/moment-js/locale/se.js +0 -61
  291. bp-core/js/vendor/moment-js/locale/se.min.js +0 -1
  292. bp-core/js/vendor/moment-js/locale/si.js +0 -71
  293. bp-core/js/vendor/moment-js/locale/si.min.js +0 -1
  294. bp-core/js/vendor/moment-js/locale/sk.js +0 -150
  295. bp-core/js/vendor/moment-js/locale/sk.min.js +0 -1
  296. bp-core/js/vendor/moment-js/locale/sl.js +0 -162
  297. bp-core/js/vendor/moment-js/locale/sl.min.js +0 -1
  298. bp-core/js/vendor/moment-js/locale/sq.js +0 -70
  299. bp-core/js/vendor/moment-js/locale/sq.min.js +0 -1
  300. bp-core/js/vendor/moment-js/locale/sr-cyrl.js +0 -110
  301. bp-core/js/vendor/moment-js/locale/sr-cyrl.min.js +0 -1
  302. bp-core/js/vendor/moment-js/locale/sr.js +0 -110
  303. bp-core/js/vendor/moment-js/locale/sr.min.js +0 -1
  304. bp-core/js/vendor/moment-js/locale/ss.js +0 -89
  305. bp-core/js/vendor/moment-js/locale/ss.min.js +0 -1
  306. bp-core/js/vendor/moment-js/locale/sv.js +0 -69
  307. bp-core/js/vendor/moment-js/locale/sv.min.js +0 -1
  308. bp-core/js/vendor/moment-js/locale/sw.js +0 -59
  309. bp-core/js/vendor/moment-js/locale/sw.min.js +0 -1
  310. bp-core/js/vendor/moment-js/locale/ta.js +0 -129
  311. bp-core/js/vendor/moment-js/locale/ta.min.js +0 -1
  312. bp-core/js/vendor/moment-js/locale/te.js +0 -89
  313. bp-core/js/vendor/moment-js/locale/te.min.js +0 -1
  314. bp-core/js/vendor/moment-js/locale/th.js +0 -67
  315. bp-core/js/vendor/moment-js/locale/th.min.js +0 -1
  316. bp-core/js/vendor/moment-js/locale/tl-ph.js +0 -62
  317. bp-core/js/vendor/moment-js/locale/tl-ph.min.js +0 -1
  318. bp-core/js/vendor/moment-js/locale/tlh.js +0 -120
  319. bp-core/js/vendor/moment-js/locale/tlh.min.js +0 -1
  320. bp-core/js/vendor/moment-js/locale/tr.js +0 -90
  321. bp-core/js/vendor/moment-js/locale/tr.min.js +0 -1
  322. bp-core/js/vendor/moment-js/locale/tzl.js +0 -91
  323. bp-core/js/vendor/moment-js/locale/tzl.min.js +0 -1
  324. bp-core/js/vendor/moment-js/locale/tzm-latn.js +0 -58
  325. bp-core/js/vendor/moment-js/locale/tzm-latn.min.js +0 -1
  326. bp-core/js/vendor/moment-js/locale/tzm.js +0 -58
  327. bp-core/js/vendor/moment-js/locale/tzm.min.js +0 -1
  328. bp-core/js/vendor/moment-js/locale/uk.js +0 -146
  329. bp-core/js/vendor/moment-js/locale/uk.min.js +0 -1
  330. bp-core/js/vendor/moment-js/locale/uz.js +0 -58
  331. bp-core/js/vendor/moment-js/locale/uz.min.js +0 -1
  332. bp-core/js/vendor/moment-js/locale/vi.js +0 -79
  333. bp-core/js/vendor/moment-js/locale/vi.min.js +0 -1
  334. bp-core/js/vendor/moment-js/locale/x-pseudo.js +0 -68
  335. bp-core/js/vendor/moment-js/locale/x-pseudo.min.js +0 -1
  336. bp-core/js/vendor/moment-js/locale/zh-cn.js +0 -127
  337. bp-core/js/vendor/moment-js/locale/zh-cn.min.js +0 -1
  338. bp-core/js/vendor/moment-js/locale/zh-hk.js +0 -105
  339. bp-core/js/vendor/moment-js/locale/zh-hk.min.js +0 -1
  340. bp-core/js/vendor/moment-js/locale/zh-tw.js +0 -104
  341. bp-core/js/vendor/moment-js/locale/zh-tw.min.js +0 -1
  342. bp-core/js/vendor/moment-js/moment.js +0 -4234
  343. bp-core/js/vendor/moment-js/moment.min.js +0 -2
  344. bp-core/js/webcam.min.js +1 -0
  345. bp-core/js/widget-members.js +1 -12
  346. bp-core/js/widget-members.min.js +2 -1
  347. bp-forums/bp-forums-bbpress-sa.php +10 -42
  348. bp-forums/bp-forums-filters.php +0 -12
  349. bp-forums/bp-forums-functions.php +0 -50
  350. bp-forums/bp-forums-loader.php +0 -29
  351. bp-forums/bp-forums-screens.php +0 -12
  352. bp-forums/bp-forums-template.php +23 -315
  353. bp-forums/deprecated/1.6.php +6 -12
  354. bp-friends/bp-friends-actions.php +2 -2
  355. bp-friends/bp-friends-activity.php +1 -1
  356. bp-friends/bp-friends-cache.php +0 -41
  357. bp-friends/bp-friends-filters.php +34 -7
  358. bp-friends/bp-friends-functions.php +0 -75
  359. bp-friends/bp-friends-loader.php +2 -4
  360. bp-friends/bp-friends-notifications.php +98 -15
  361. bp-friends/bp-friends-screens.php +4 -16
  362. bp-friends/bp-friends-template.php +18 -20
  363. bp-friends/bp-friends-widgets.php +3 -5
  364. bp-friends/classes/class-bp-core-friends-widget.php +15 -23
  365. bp-friends/classes/class-bp-friends-component.php +8 -36
  366. bp-friends/classes/class-bp-friends-friendship.php +54 -305
  367. bp-friends/js/widget-friends.js +1 -12
  368. bp-friends/js/widget-friends.min.js +2 -1
  369. bp-groups/admin/css/admin-rtl.css +7 -17
  370. bp-groups/admin/css/admin-rtl.min.css +1 -1
  371. bp-groups/admin/css/admin.css +7 -17
  372. bp-groups/admin/css/admin.min.css +1 -1
  373. bp-groups/admin/js/admin.min.js +2 -1
  374. bp-groups/bp-groups-actions.php +7 -53
  375. bp-groups/bp-groups-activity.php +15 -7
  376. bp-groups/bp-groups-admin.php +23 -229
  377. bp-groups/bp-groups-adminbar.php +9 -9
  378. bp-groups/bp-groups-cache.php +3 -114
  379. bp-groups/bp-groups-filters.php +2 -29
  380. bp-groups/bp-groups-forums.php +1 -1
  381. bp-groups/bp-groups-functions.php +78 -718
  382. bp-groups/bp-groups-loader.php +2 -4
  383. bp-groups/bp-groups-notifications.php +11 -53
  384. bp-groups/bp-groups-screens.php +12 -97
  385. bp-groups/bp-groups-template.php +192 -458
  386. bp-groups/bp-groups-widgets.php +12 -10
  387. bp-groups/classes/class-bp-group-extension.php +13 -7
  388. bp-groups/classes/class-bp-groups-component.php +26 -79
  389. bp-groups/classes/class-bp-groups-group-members-template.php +3 -5
  390. bp-groups/classes/class-bp-groups-group.php +267 -500
  391. bp-groups/classes/class-bp-groups-invite-template.php +2 -4
  392. bp-groups/classes/class-bp-groups-list-table.php +9 -160
  393. bp-groups/classes/class-bp-groups-member-suggestions.php +6 -1
  394. bp-groups/classes/class-bp-groups-member.php +26 -134
  395. bp-groups/classes/class-bp-groups-template.php +33 -38
  396. bp-groups/classes/class-bp-groups-theme-compat.php +4 -8
  397. bp-groups/classes/class-bp-groups-widget.php +6 -16
  398. bp-groups/js/widget-groups.js +1 -12
  399. bp-groups/js/widget-groups.min.js +2 -1
  400. bp-loader.php +25 -145
  401. bp-members/admin/css/admin-rtl.css +8 -98
  402. bp-members/admin/css/admin-rtl.min.css +1 -1
  403. bp-members/admin/css/admin.css +8 -98
  404. bp-members/admin/css/admin.min.css +1 -1
  405. bp-members/admin/js/admin.min.js +1 -0
  406. bp-members/bp-members-actions.php +0 -4
  407. bp-members/bp-members-activity.php +2 -2
  408. bp-members/bp-members-admin.php +1 -3
  409. bp-members/bp-members-adminbar.php +2 -2
  410. bp-members/bp-members-cache.php +2 -14
  411. bp-members/bp-members-filters.php +1 -1
  412. bp-members/bp-members-functions.php +23 -149
  413. bp-members/bp-members-loader.php +1 -5
  414. bp-members/bp-members-screens.php +6 -16
  415. bp-members/bp-members-template.php +69 -389
  416. bp-members/bp-members-widgets.php +3 -5
  417. bp-members/classes/class-bp-core-members-template.php +0 -25
  418. bp-members/classes/class-bp-core-members-widget.php +20 -31
  419. bp-members/classes/class-bp-core-recently-active-widget.php +6 -12
  420. bp-members/classes/class-bp-core-whos-online-widget.php +7 -12
  421. bp-members/classes/class-bp-members-admin.php +8 -300
  422. bp-members/classes/class-bp-members-component.php +29 -121
  423. bp-members/classes/class-bp-members-list-table.php +9 -12
  424. bp-members/classes/class-bp-members-ms-list-table.php +8 -11
  425. bp-members/classes/class-bp-signup.php +0 -10
  426. bp-messages/bp-messages-functions.php +14 -112
  427. bp-messages/bp-messages-loader.php +2 -6
  428. bp-messages/bp-messages-notifications.php +125 -85
  429. bp-messages/bp-messages-screens.php +3 -12
  430. bp-messages/bp-messages-template.php +20 -30
  431. bp-messages/bp-messages-widgets.php +1 -3
  432. bp-messages/classes/class-bp-messages-component.php +5 -26
  433. bp-messages/classes/class-bp-messages-message.php +6 -12
  434. bp-messages/classes/class-bp-messages-notice.php +2 -8
  435. bp-messages/classes/class-bp-messages-sitewide-notices-widget.php +2 -3
  436. bp-messages/classes/class-bp-messages-thread.php +7 -30
  437. bp-messages/css/autocomplete/jquery.autocompletefb-rtl.css +2 -2
  438. bp-messages/css/autocomplete/jquery.autocompletefb-rtl.min.css +1 -1
  439. bp-messages/js/autocomplete/jquery.autocomplete.js +1 -2
  440. bp-messages/js/autocomplete/jquery.autocomplete.min.js +2 -1
  441. bp-messages/js/autocomplete/jquery.autocompletefb.js +1 -1
  442. bp-messages/js/autocomplete/jquery.autocompletefb.min.js +2 -1
  443. bp-messages/js/autocomplete/jquery.bgiframe.min.js +1 -0
  444. bp-messages/js/autocomplete/jquery.dimensions.min.js +2 -1
  445. bp-notifications/bp-notifications-functions.php +16 -37
  446. bp-notifications/bp-notifications-loader.php +2 -4
  447. bp-notifications/bp-notifications-template.php +102 -204
  448. bp-notifications/classes/class-bp-notifications-component.php +4 -29
  449. bp-notifications/classes/class-bp-notifications-notification.php +21 -38
  450. bp-settings/bp-settings-actions.php +2 -2
  451. bp-settings/bp-settings-loader.php +2 -4
  452. bp-settings/bp-settings-template.php +7 -8
  453. bp-templates/bp-legacy/buddypress-functions.php +74 -79
  454. bp-templates/bp-legacy/buddypress/activity/comment.php +2 -2
  455. bp-templates/bp-legacy/buddypress/activity/entry.php +3 -6
  456. bp-templates/bp-legacy/buddypress/activity/index.php +15 -18
  457. bp-templates/bp-legacy/buddypress/activity/post-form.php +2 -8
  458. bp-templates/bp-legacy/buddypress/activity/single/home.php +3 -7
  459. bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/index.php +2 -2
  460. bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php +2 -2
  461. bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php +1 -4
  462. bp-templates/bp-legacy/buddypress/assets/embeds/activity.php +0 -11
  463. bp-templates/bp-legacy/buddypress/assets/embeds/footer.php +0 -9
  464. bp-templates/bp-legacy/buddypress/assets/embeds/header-activity.php +0 -26
  465. bp-templates/bp-legacy/buddypress/assets/embeds/header.php +0 -18
  466. bp-templates/bp-legacy/buddypress/blogs/create.php +3 -6
  467. bp-templates/bp-legacy/buddypress/blogs/index.php +5 -19
  468. bp-templates/bp-legacy/buddypress/common/search/dir-search-form.php +0 -16
  469. bp-templates/bp-legacy/buddypress/forums/index.php +7 -18
  470. bp-templates/bp-legacy/buddypress/groups/create.php +33 -96
  471. bp-templates/bp-legacy/buddypress/groups/groups-loop.php +2 -6
  472. bp-templates/bp-legacy/buddypress/groups/index.php +8 -25
  473. bp-templates/bp-legacy/buddypress/groups/single/activity.php +2 -2
  474. bp-templates/bp-legacy/buddypress/groups/single/admin.php +437 -19
  475. bp-templates/bp-legacy/buddypress/groups/single/admin/delete-group.php +0 -41
  476. bp-templates/bp-legacy/buddypress/groups/single/admin/edit-details.php +0 -53
  477. bp-templates/bp-legacy/buddypress/groups/single/admin/group-avatar.php +0 -67
  478. bp-templates/bp-legacy/buddypress/groups/single/admin/group-cover-image.php +0 -33
  479. bp-templates/bp-legacy/buddypress/groups/single/admin/group-settings.php +0 -124
  480. bp-templates/bp-legacy/buddypress/groups/single/admin/manage-members.php +0 -332
  481. bp-templates/bp-legacy/buddypress/groups/single/admin/membership-requests.php +0 -35
  482. bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php +8 -14
  483. bp-templates/bp-legacy/buddypress/groups/single/forum.php +1 -1
  484. bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php +2 -5
  485. bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php +2 -5
  486. bp-templates/bp-legacy/buddypress/groups/single/group-header.php +8 -14
  487. bp-templates/bp-legacy/buddypress/groups/single/home.php +1 -1
  488. bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php +1 -1
  489. bp-templates/bp-legacy/buddypress/groups/single/members.php +1 -1
  490. bp-templates/bp-legacy/buddypress/groups/single/request-membership.php +0 -5
  491. bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php +13 -22
  492. bp-templates/bp-legacy/buddypress/groups/single/send-invites.php +1 -3
  493. bp-templates/bp-legacy/buddypress/members/activate.php +3 -6
  494. bp-templates/bp-legacy/buddypress/members/index.php +7 -20
  495. bp-templates/bp-legacy/buddypress/members/members-loop.php +2 -2
  496. bp-templates/bp-legacy/buddypress/members/register.php +27 -43
  497. bp-templates/bp-legacy/buddypress/members/single/activity.php +2 -2
  498. bp-templates/bp-legacy/buddypress/members/single/blogs.php +1 -1
  499. bp-templates/bp-legacy/buddypress/members/single/cover-image-header.php +4 -7
  500. bp-templates/bp-legacy/buddypress/members/single/forums.php +1 -1
  501. bp-templates/bp-legacy/buddypress/members/single/friends.php +1 -13
  502. bp-templates/bp-legacy/buddypress/members/single/friends/requests.php +0 -5
  503. bp-templates/bp-legacy/buddypress/members/single/groups.php +1 -13
  504. bp-templates/bp-legacy/buddypress/members/single/groups/invites.php +0 -5
  505. bp-templates/bp-legacy/buddypress/members/single/home.php +2 -5
  506. bp-templates/bp-legacy/buddypress/members/single/member-header.php +4 -7
  507. bp-templates/bp-legacy/buddypress/members/single/messages.php +1 -18
  508. bp-templates/bp-legacy/buddypress/members/single/messages/compose.php +0 -5
  509. bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php +3 -17
  510. bp-templates/bp-legacy/buddypress/members/single/messages/single.php +3 -6
  511. bp-templates/bp-legacy/buddypress/members/single/notifications.php +1 -1
  512. bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php +2 -8
  513. bp-templates/bp-legacy/buddypress/members/single/notifications/read.php +0 -5
  514. bp-templates/bp-legacy/buddypress/members/single/notifications/unread.php +0 -5
  515. bp-templates/bp-legacy/buddypress/members/single/plugins.php +1 -1
  516. bp-templates/bp-legacy/buddypress/members/single/profile.php +1 -1
  517. bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php +3 -6
  518. bp-templates/bp-legacy/buddypress/members/single/profile/change-cover-image.php +1 -1
  519. bp-templates/bp-legacy/buddypress/members/single/profile/edit.php +2 -2
  520. bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php +1 -1
  521. bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php +1 -1
  522. bp-templates/bp-legacy/buddypress/members/single/settings.php +1 -1
  523. bp-templates/bp-legacy/buddypress/members/single/settings/general.php +1 -9
  524. bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php +0 -5
  525. bp-templates/bp-legacy/buddypress/members/single/settings/profile.php +0 -5
  526. bp-templates/bp-legacy/css/buddypress-rtl.css +12 -49
  527. bp-templates/bp-legacy/css/buddypress-rtl.min.css +1 -1
  528. bp-templates/bp-legacy/css/buddypress.css +12 -49
  529. bp-templates/bp-legacy/css/buddypress.min.css +1 -1
  530. bp-templates/bp-legacy/css/embeds-activity-rtl.css +0 -152
  531. bp-templates/bp-legacy/css/embeds-activity-rtl.min.css +0 -1
  532. bp-templates/bp-legacy/css/embeds-activity.css +0 -152
  533. bp-templates/bp-legacy/css/embeds-activity.min.css +0 -1
  534. bp-templates/bp-legacy/css/twentyeleven-rtl.css +0 -2025
  535. bp-templates/bp-legacy/css/twentyeleven-rtl.min.css +0 -1
  536. bp-templates/bp-legacy/css/twentyeleven.css +0 -2025
  537. bp-templates/bp-legacy/css/twentyeleven.min.css +0 -1
  538. bp-templates/bp-legacy/css/twentyeleven.scss +0 -2577
  539. bp-templates/bp-legacy/css/twentyfifteen-rtl.css +5 -15
  540. bp-templates/bp-legacy/css/twentyfifteen-rtl.min.css +1 -1
  541. bp-templates/bp-legacy/css/twentyfifteen.css +5 -15
  542. bp-templates/bp-legacy/css/twentyfifteen.min.css +1 -1
  543. bp-templates/bp-legacy/css/twentyfifteen.scss +5 -18
  544. bp-templates/bp-legacy/css/twentyfourteen-rtl.css +7 -28
  545. bp-templates/bp-legacy/css/twentyfourteen-rtl.min.css +1 -1
  546. bp-templates/bp-legacy/css/twentyfourteen.css +7 -28
  547. bp-templates/bp-legacy/css/twentyfourteen.min.css +1 -1
  548. bp-templates/bp-legacy/css/twentyfourteen.scss +8 -32
  549. bp-templates/bp-legacy/css/twentysixteen-rtl.css +9 -41
  550. bp-templates/bp-legacy/css/twentysixteen-rtl.min.css +1 -1
  551. bp-templates/bp-legacy/css/twentysixteen.css +9 -41
  552. bp-templates/bp-legacy/css/twentysixteen.min.css +1 -1
  553. bp-templates/bp-legacy/css/twentysixteen.scss +7 -49
  554. bp-templates/bp-legacy/css/twentyten-rtl.css +0 -1976
  555. bp-templates/bp-legacy/css/twentyten-rtl.min.css +0 -1
  556. bp-templates/bp-legacy/css/twentyten.css +0 -1976
  557. bp-templates/bp-legacy/css/twentyten.min.css +0 -1
  558. bp-templates/bp-legacy/css/twentyten.scss +0 -2478
  559. bp-templates/bp-legacy/css/twentythirteen-rtl.css +12 -21
  560. bp-templates/bp-legacy/css/twentythirteen-rtl.min.css +1 -1
  561. bp-templates/bp-legacy/css/twentythirteen.css +12 -21
  562. bp-templates/bp-legacy/css/twentythirteen.min.css +1 -1
  563. bp-templates/bp-legacy/css/twentythirteen.scss +12 -21
  564. bp-templates/bp-legacy/css/twentytwelve-rtl.css +6 -10
  565. bp-templates/bp-legacy/css/twentytwelve-rtl.min.css +1 -1
  566. bp-templates/bp-legacy/css/twentytwelve.css +6 -10
  567. bp-templates/bp-legacy/css/twentytwelve.min.css +1 -1
  568. bp-templates/bp-legacy/css/twentytwelve.scss +7 -10
  569. bp-templates/bp-legacy/js/buddypress.js +18 -45
  570. bp-templates/bp-legacy/js/buddypress.min.js +3 -2
  571. bp-templates/bp-legacy/js/password-verify.min.js +2 -1
  572. bp-themes/bp-default/_inc/ajax.php +4 -11
  573. bp-themes/bp-default/groups/single/home.php +0 -3
  574. bp-xprofile/admin/css/admin-rtl.css +0 -76
  575. bp-xprofile/admin/css/admin-rtl.min.css +1 -1
  576. bp-xprofile/admin/css/admin.css +0 -76
  577. bp-xprofile/admin/css/admin.min.css +1 -1
  578. bp-xprofile/admin/js/admin.js +3 -44
  579. bp-xprofile/admin/js/admin.min.js +2 -1
  580. bp-xprofile/bp-xprofile-actions.php +2 -2
  581. bp-xprofile/bp-xprofile-activity.php +6 -1
  582. bp-xprofile/bp-xprofile-admin.php +13 -27
  583. bp-xprofile/bp-xprofile-caps.php +6 -22
  584. bp-xprofile/bp-xprofile-cssjs.php +3 -3
  585. bp-xprofile/bp-xprofile-filters.php +9 -8
  586. bp-xprofile/bp-xprofile-functions.php +12 -55
  587. bp-xprofile/bp-xprofile-loader.php +2 -6
  588. bp-xprofile/bp-xprofile-screens.php +7 -6
  589. bp-xprofile/bp-xprofile-settings.php +2 -0
  590. bp-xprofile/bp-xprofile-template.php +25 -163
  591. bp-xprofile/classes/class-bp-xprofile-component.php +2 -16
  592. bp-xprofile/classes/class-bp-xprofile-data-template.php +0 -21
  593. bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php +6 -9
  594. bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php +52 -366
  595. bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php +1 -4
  596. bp-xprofile/classes/class-bp-xprofile-field-type-number.php +1 -4
  597. bp-xprofile/classes/class-bp-xprofile-field-type-placeholder.php +0 -2
  598. bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php +8 -11
  599. bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php +1 -4
  600. bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php +1 -4
  601. bp-xprofile/classes/class-bp-xprofile-field-type-url.php +5 -8
  602. bp-xprofile/classes/class-bp-xprofile-field-type.php +2 -42
  603. bp-xprofile/classes/class-bp-xprofile-field.php +35 -61
  604. bp-xprofile/classes/class-bp-xprofile-group.php +10 -38
  605. bp-xprofile/classes/class-bp-xprofile-meta-query.php +4 -1
  606. bp-xprofile/classes/class-bp-xprofile-profiledata.php +12 -77
  607. bp-xprofile/classes/class-bp-xprofile-query.php +1 -1
  608. bp-xprofile/classes/class-bp-xprofile-user-admin.php +19 -41
  609. buddypress.pot +2238 -2899
  610. composer.json +5 -6
  611. humans.txt +1 -14
  612. readme.txt +153 -46
bp-activity/admin/js/admin.min.js CHANGED
@@ -1 +1,2 @@
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);
1
+ /*! buddypress - v2.5.3 - 2016-05-24 5:17:45 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){var b={init:function(){a(document).on("click",".row-actions a.reply",b.open),a(document).on("click","#bp-activities-container a.cancel",b.close),a(document).on("click","#bp-activities-container a.save",b.send),a(document).on("keyup","#bp-activities:visible",function(a){27===a.which&&b.close()})},open:function(){var b=a("#bp-activities-container").hide();return a(this).parents("tr").after(b),b.fadeIn("300"),a("#bp-activities").focus(),!1},close:function(){return a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide()}),!1},send:function(){a("#bp-replysubmit .error").hide(),a("#bp-replysubmit .waiting").show();var c={};return c["_ajax_nonce-bp-activity-admin-reply"]=a('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),c.action="bp-activity-admin-reply",c.content=a("#bp-activities").val(),c.parent_id=a("#bp-activities-container").prev().data("parent_id"),c.root_id=a("#bp-activities-container").prev().data("root_id"),a.ajax({data:c,type:"POST",url:ajaxurl,error:function(a){b.error(a)},success:function(a){b.show(a)}}),!1},error:function(b){var c=b.statusText;a("#bp-replysubmit .waiting").hide(),b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&a("#bp-replysubmit .error").html(c).show()},show:function(c){var d,e,f;return"string"==typeof c?(b.error({responseText:c}),!1):(f=wpAjax.parseAjaxResponse(c),f.errors?(b.error({responseText:wpAjax.broken}),!1):(f=f.responses[0],void a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide(),a("#bp-activities-container").before(f.data),e=a("#activity-"+f.id),d=e.closest(".widefat").css("backgroundColor"),e.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:d},300)})))}};a(document).ready(function(){b.init(),a("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
bp-activity/bp-activity-actions.php CHANGED
@@ -17,6 +17,7 @@ defined( 'ABSPATH' ) || exit;
17
*
18
* @since 1.2.0
19
*
20
*/
21
function bp_register_activity_actions() {
22
@@ -34,6 +35,18 @@ add_action( 'bp_init', 'bp_register_activity_actions', 8 );
34
*
35
* @since 1.2.0
36
*
37
* @return bool False on failure.
38
*/
39
function bp_activity_action_permalink_router() {
@@ -71,7 +84,7 @@ function bp_activity_action_permalink_router() {
71
} else {
72
73
// Set redirect to group activity stream.
74
- if ( $group = groups_get_group( $activity->item_id ) ) {
75
$redirect = bp_get_group_permalink( $group ) . bp_get_activity_slug() . '/' . $activity->id . '/';
76
}
77
}
@@ -109,6 +122,17 @@ add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
109
*
110
* @since 1.1.0
111
*
112
* @param int $activity_id Activity id to be deleted. Defaults to 0.
113
* @return bool False on failure.
114
*/
@@ -243,6 +267,20 @@ add_action( 'bp_actions', 'bp_activity_action_spam_activity' );
243
*
244
* @since 1.2.0
245
*
246
* @return bool False on failure.
247
*/
248
function bp_activity_action_post_update() {
@@ -333,6 +371,17 @@ add_action( 'bp_actions', 'bp_activity_action_post_update' );
333
*
334
* @since 1.2.0
335
*
336
* @return bool False on failure.
337
*/
338
function bp_activity_action_post_comment() {
@@ -386,6 +435,16 @@ add_action( 'bp_actions', 'bp_activity_action_post_comment' );
386
*
387
* @since 1.2.0
388
*
389
* @return bool False on failure.
390
*/
391
function bp_activity_action_mark_favorite() {
@@ -410,6 +469,16 @@ add_action( 'bp_actions', 'bp_activity_action_mark_favorite' );
410
*
411
* @since 1.2.0
412
*
413
* @return bool False on failure.
414
*/
415
function bp_activity_action_remove_favorite() {
@@ -434,6 +503,11 @@ add_action( 'bp_actions', 'bp_activity_action_remove_favorite' );
434
*
435
* @since 1.0.0
436
*
437
* @return bool False on failure.
438
*/
439
function bp_activity_action_sitewide_feed() {
@@ -461,6 +535,10 @@ add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
461
*
462
* @since 1.0.0
463
*
464
* @return bool False on failure.
465
*/
466
function bp_activity_action_personal_feed() {
@@ -487,6 +565,13 @@ add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
487
*
488
* @since 1.0.0
489
*
490
* @return bool False on failure.
491
*/
492
function bp_activity_action_friends_feed() {
@@ -513,6 +598,13 @@ add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
513
*
514
* @since 1.2.0
515
*
516
* @return bool False on failure.
517
*/
518
function bp_activity_action_my_groups_feed() {
@@ -547,6 +639,11 @@ add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
547
*
548
* @since 1.2.0
549
*
550
* @return bool False on failure.
551
*/
552
function bp_activity_action_mentions_feed() {
@@ -579,6 +676,11 @@ add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
579
*
580
* @since 1.2.0
581
*
582
* @return bool False on failure.
583
*/
584
function bp_activity_action_favorites_feed() {
@@ -604,6 +706,45 @@ function bp_activity_action_favorites_feed() {
604
}
605
add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
606
607
/**
608
* AJAX endpoint for Suggestions API lookups.
609
*
17
*
18
* @since 1.2.0
19
*
20
+ * @uses do_action() To call 'bp_register_activity_actions' hook.
21
*/
22
function bp_register_activity_actions() {
23
35
*
36
* @since 1.2.0
37
*
38
+ * @uses bp_is_activity_component()
39
+ * @uses bp_is_current_action()
40
+ * @uses bp_action_variable()
41
+ * @uses bp_activity_get_specific()
42
+ * @uses bp_is_active()
43
+ * @uses bp_core_get_user_domain()
44
+ * @uses groups_get_group()
45
+ * @uses bp_get_group_permalink()
46
+ * @uses apply_filters_ref_array() To call the 'bp_activity_permalink_redirect_url' hook.
47
+ * @uses bp_core_redirect()
48
+ * @uses bp_get_root_domain()
49
+ *
50
* @return bool False on failure.
51
*/
52
function bp_activity_action_permalink_router() {
84
} else {
85
86
// Set redirect to group activity stream.
87
+ if ( $group = groups_get_group( array( 'group_id' => $activity->item_id ) ) ) {
88
$redirect = bp_get_group_permalink( $group ) . bp_get_activity_slug() . '/' . $activity->id . '/';
89
}
90
}
122
*
123
* @since 1.1.0
124
*
125
+ * @uses bp_is_activity_component()
126
+ * @uses bp_is_current_action()
127
+ * @uses bp_action_variable()
128
+ * @uses check_admin_referer()
129
+ * @uses bp_activity_user_can_delete()
130
+ * @uses do_action() Calls 'bp_activity_before_action_delete_activity' hook to allow actions to be taken before the activity is deleted.
131
+ * @uses bp_activity_delete()
132
+ * @uses bp_core_add_message()
133
+ * @uses do_action() Calls 'bp_activity_action_delete_activity' hook to allow actions to be taken after the activity is deleted.
134
+ * @uses bp_core_redirect()
135
+ *
136
* @param int $activity_id Activity id to be deleted. Defaults to 0.
137
* @return bool False on failure.
138
*/
267
*
268
* @since 1.2.0
269
*
270
+ * @uses is_user_logged_in()
271
+ * @uses bp_is_activity_component()
272
+ * @uses bp_is_current_action()
273
+ * @uses check_admin_referer()
274
+ * @uses apply_filters() To call 'bp_activity_post_update_content' hook.
275
+ * @uses apply_filters() To call 'bp_activity_post_update_object' hook.
276
+ * @uses apply_filters() To call 'bp_activity_post_update_item_id' hook.
277
+ * @uses bp_core_add_message()
278
+ * @uses bp_core_redirect()
279
+ * @uses bp_activity_post_update()
280
+ * @uses groups_post_update()
281
+ * @uses bp_core_redirect()
282
+ * @uses apply_filters() To call 'bp_activity_custom_update' hook.
283
+ *
284
* @return bool False on failure.
285
*/
286
function bp_activity_action_post_update() {
371
*
372
* @since 1.2.0
373
*
374
+ * @uses is_user_logged_in()
375
+ * @uses bp_is_activity_component()
376
+ * @uses bp_is_current_action()
377
+ * @uses check_admin_referer()
378
+ * @uses apply_filters() To call 'bp_activity_post_comment_activity_id' hook.
379
+ * @uses apply_filters() To call 'bp_activity_post_comment_content' hook.
380
+ * @uses bp_core_add_message()
381
+ * @uses bp_core_redirect()
382
+ * @uses bp_activity_new_comment()
383
+ * @uses wp_get_referer()
384
+ *
385
* @return bool False on failure.
386
*/
387
function bp_activity_action_post_comment() {
435
*
436
* @since 1.2.0
437
*
438
+ * @uses is_user_logged_in()
439
+ * @uses bp_is_activity_component()
440
+ * @uses bp_is_current_action()
441
+ * @uses check_admin_referer()
442
+ * @uses bp_activity_add_user_favorite()
443
+ * @uses bp_action_variable()
444
+ * @uses bp_core_add_message()
445
+ * @uses bp_core_redirect()
446
+ * @uses wp_get_referer()
447
+ *
448
* @return bool False on failure.
449
*/
450
function bp_activity_action_mark_favorite() {
469
*
470
* @since 1.2.0
471
*
472
+ * @uses is_user_logged_in()
473
+ * @uses bp_is_activity_component()
474
+ * @uses bp_is_current_action()
475
+ * @uses check_admin_referer()
476
+ * @uses bp_activity_remove_user_favorite()
477
+ * @uses bp_action_variable()
478
+ * @uses bp_core_add_message()
479
+ * @uses bp_core_redirect()
480
+ * @uses wp_get_referer()
481
+ *
482
* @return bool False on failure.
483
*/
484
function bp_activity_action_remove_favorite() {
503
*
504
* @since 1.0.0
505
*
506
+ * @uses bp_is_activity_component()
507
+ * @uses bp_is_current_action()
508
+ * @uses bp_is_user()
509
+ * @uses status_header()
510
+ *
511
* @return bool False on failure.
512
*/
513
function bp_activity_action_sitewide_feed() {
535
*
536
* @since 1.0.0
537
*
538
+ * @uses bp_is_user_activity()
539
+ * @uses bp_is_current_action()
540
+ * @uses status_header()
541
+ *
542
* @return bool False on failure.
543
*/
544
function bp_activity_action_personal_feed() {
565
*
566
* @since 1.0.0
567
*
568
+ * @uses bp_is_active()
569
+ * @uses bp_is_user_activity()
570
+ * @uses bp_is_current_action()
571
+ * @uses bp_get_friends_slug()
572
+ * @uses bp_is_action_variable()
573
+ * @uses status_header()
574
+ *
575
* @return bool False on failure.
576
*/
577
function bp_activity_action_friends_feed() {
598
*
599
* @since 1.2.0
600
*
601
+ * @uses bp_is_active()
602
+ * @uses bp_is_user_activity()
603
+ * @uses bp_is_current_action()
604
+ * @uses bp_get_groups_slug()
605
+ * @uses bp_is_action_variable()
606
+ * @uses status_header()
607
+ *
608
* @return bool False on failure.
609
*/
610
function bp_activity_action_my_groups_feed() {
639
*
640
* @since 1.2.0
641
*
642
+ * @uses bp_is_user_activity()
643
+ * @uses bp_is_current_action()
644
+ * @uses bp_is_action_variable()
645
+ * @uses status_header()
646
+ *
647
* @return bool False on failure.
648
*/
649
function bp_activity_action_mentions_feed() {
676
*
677
* @since 1.2.0
678
*
679
+ * @uses bp_is_user_activity()
680
+ * @uses bp_is_current_action()
681
+ * @uses bp_is_action_variable()
682
+ * @uses status_header()
683
+ *
684
* @return bool False on failure.
685
*/
686
function bp_activity_action_favorites_feed() {
706
}
707
add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
708
709
+ /**
710
+ * Loads Akismet filtering for activity.
711
+ *
712
+ * @since 1.6.0
713
+ * @since 2.3.0 We only support Akismet 3+.
714
+ */
715
+ function bp_activity_setup_akismet() {
716
+ $bp = buddypress();
717
+
718
+ // Bail if Akismet is not active.
719
+ if ( ! defined( 'AKISMET_VERSION' ) ) {
720
+ return;
721
+ }
722
+
723
+ // Bail if older version of Akismet.
724
+ if ( ! class_exists( 'Akismet' ) ) {
725
+ return;
726
+ }
727
+
728
+ // Bail if no Akismet key is set.
729
+ if ( ! bp_get_option( 'wordpress_api_key' ) && ! defined( 'WPCOM_API_KEY' ) ) {
730
+ return;
731
+ }
732
+
733
+ /**
734
+ * Filters if BuddyPress Activity Akismet support has been disabled by another plugin.
735
+ *
736
+ * @since 1.6.0
737
+ *
738
+ * @param bool $value Return value of bp_is_akismet_active boolean function.
739
+ */
740
+ if ( ! apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) {
741
+ return;
742
+ }
743
+
744
+ // Instantiate Akismet for BuddyPress.
745
+ $bp->activity->akismet = new BP_Akismet();
746
+ }
747
+
748
/**
749
* AJAX endpoint for Suggestions API lookups.
750
*
bp-activity/bp-activity-admin.php CHANGED
@@ -16,9 +16,7 @@ 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
- 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'] )
@@ -301,7 +299,6 @@ function bp_activity_admin_load() {
301
// Add accessible hidden heading and text for Activity screen pagination.
302
if ( bp_get_major_wp_version() >= 4.4 ) {
303
get_current_screen()->set_screen_reader_content( array(
304
- /* translators: accessibility text */
305
'heading_pagination' => __( 'Activity list navigation', 'buddypress' ),
306
) );
307
}
@@ -579,9 +576,9 @@ function bp_activity_admin_load() {
579
580
// If an error occurred, pass back the activity ID that failed.
581
if ( $error )
582
- $redirect_to = add_query_arg( 'error', $error, $redirect_to );
583
else
584
- $redirect_to = add_query_arg( 'updated', $activity->id, $redirect_to );
585
586
/**
587
* Filters URL to redirect to after saving.
@@ -677,10 +674,6 @@ function bp_activity_admin_edit() {
677
<div id="bp_activity_action" class="postbox">
678
<h2><?php _e( 'Action', 'buddypress' ); ?></h2>
679
<div class="inside">
680
- <label for="bp-activities-action" class="screen-reader-text"><?php
681
- /* translators: accessibility text */
682
- _e( 'Edit activity action', 'buddypress' );
683
- ?></label>
684
<?php wp_editor( stripslashes( $activity->action ), 'bp-activities-action', array( 'media_buttons' => false, 'textarea_rows' => 7, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?>
685
</div>
686
</div>
@@ -688,10 +681,6 @@ function bp_activity_admin_edit() {
688
<div id="bp_activity_content" class="postbox">
689
<h2><?php _e( 'Content', 'buddypress' ); ?></h2>
690
<div class="inside">
691
- <label for="bp-activities-content" class="screen-reader-text"><?php
692
- /* translators: accessibility text */
693
- _e( 'Edit activity content', 'buddypress' );
694
- ?></label>
695
<?php wp_editor( stripslashes( $activity->content ), 'bp-activities-content', array( 'media_buttons' => false, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?>
696
</div>
697
</div>
@@ -715,16 +704,10 @@ function bp_activity_admin_edit() {
715
</form>
716
717
<?php else : ?>
718
-
719
- <p><?php
720
- printf(
721
- '%1$s <a href="%2$s">%3$s</a>',
722
- __( 'No activity found with this ID.', 'buddypress' ),
723
- esc_url( bp_get_admin_url( 'admin.php?page=bp-activity' ) ),
724
- __( 'Go back and try again.', 'buddypress' )
725
- );
726
- ?></p>
727
-
728
<?php endif; ?>
729
730
</div><!-- .wrap -->
@@ -798,10 +781,7 @@ function bp_activity_admin_edit_metabox_status( $item ) {
798
function bp_activity_admin_edit_metabox_link( $item ) {
799
?>
800
801
- <label class="screen-reader-text" for="bp-activities-link"><?php
802
- /* translators: accessibility text */
803
- _e( 'Link', 'buddypress' );
804
- ?></label>
805
<input type="url" name="bp-activities-link" id="bp-activities-link" value="<?php echo esc_url( $item->primary_link ); ?>" aria-describedby="bp-activities-link-description" />
806
<p id="bp-activities-link-description"><?php _e( 'Activity generated by posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item.', 'buddypress' ); ?></p>
807
@@ -818,10 +798,7 @@ function bp_activity_admin_edit_metabox_link( $item ) {
818
function bp_activity_admin_edit_metabox_userid( $item ) {
819
?>
820
821
- <label class="screen-reader-text" for="bp-activities-userid"><?php
822
- /* translators: accessibility text */
823
- _e( 'Author ID', 'buddypress' );
824
- ?></label>
825
<input type="number" name="bp-activities-userid" id="bp-activities-userid" value="<?php echo esc_attr( $item->user_id ); ?>" min="1" />
826
827
<?php
@@ -896,10 +873,7 @@ function bp_activity_admin_edit_metabox_type( $item ) {
896
897
?>
898
899
- <label for="bp-activities-type" class="screen-reader-text"><?php
900
- /* translators: accessibility text */
901
- esc_html_e( 'Select activity type', 'buddypress' );
902
- ?></label>
903
<select name="bp-activities-type" id="bp-activities-type">
904
<?php foreach ( $actions as $k => $v ) : ?>
905
<option value="<?php echo esc_attr( $k ); ?>" <?php selected( $k, $selected ); ?>><?php echo esc_html( $v ); ?></option>
@@ -1042,10 +1016,6 @@ function bp_activity_admin_index() {
1042
<form method="get" action="">
1043
1044
<h3 id="bp-replyhead"><?php _e( 'Reply to Activity', 'buddypress' ); ?></h3>
1045
- <label for="bp-activities" class="screen-reader-text"><?php
1046
- /* translators: accessibility text */
1047
- _e( 'Reply', 'buddypress' );
1048
- ?></label>
1049
<?php wp_editor( '', 'bp-activities', array( 'dfw' => false, 'media_buttons' => false, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ), 'tinymce' => false, ) ); ?>
1050
1051
<p id="bp-replysubmit" class="submit">
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
+ require dirname( __FILE__ ) . '/classes/class-bp-activity-list-table.php';
20
21
// Per_page screen option. Has to be hooked in extremely early.
22
if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' == $_REQUEST['page'] )
299
// Add accessible hidden heading and text for Activity screen pagination.
300
if ( bp_get_major_wp_version() >= 4.4 ) {
301
get_current_screen()->set_screen_reader_content( array(
302
'heading_pagination' => __( 'Activity list navigation', 'buddypress' ),
303
) );
304
}
576
577
// If an error occurred, pass back the activity ID that failed.
578
if ( $error )
579
+ $redirect_to = add_query_arg( 'error', (int) $error, $redirect_to );
580
else
581
+ $redirect_to = add_query_arg( 'updated', (int) $activity->id, $redirect_to );
582
583
/**
584
* Filters URL to redirect to after saving.
674
<div id="bp_activity_action" class="postbox">
675
<h2><?php _e( 'Action', 'buddypress' ); ?></h2>
676
<div class="inside">
677
<?php wp_editor( stripslashes( $activity->action ), 'bp-activities-action', array( 'media_buttons' => false, 'textarea_rows' => 7, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?>
678
</div>
679
</div>
681
<div id="bp_activity_content" class="postbox">
682
<h2><?php _e( 'Content', 'buddypress' ); ?></h2>
683
<div class="inside">
684
<?php wp_editor( stripslashes( $activity->content ), 'bp-activities-content', array( 'media_buttons' => false, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?>
685
</div>
686
</div>
704
</form>
705
706
<?php else : ?>
707
+ <p>
708
+ <?php _e( 'No activity found with this ID.', 'buddypress' ); ?>
709
+ <a href="<?php echo esc_url( bp_get_admin_url( 'admin.php?page=bp-activity' ) ); ?>"><?php _e( 'Go back and try again.', 'buddypress' ); ?></a>
710
+ </p>
711
<?php endif; ?>
712
713
</div><!-- .wrap -->
781
function bp_activity_admin_edit_metabox_link( $item ) {
782
?>
783
784
+ <label class="screen-reader-text" for="bp-activities-link"><?php _e( 'Link', 'buddypress' ); ?></label>
785
<input type="url" name="bp-activities-link" id="bp-activities-link" value="<?php echo esc_url( $item->primary_link ); ?>" aria-describedby="bp-activities-link-description" />
786
<p id="bp-activities-link-description"><?php _e( 'Activity generated by posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item.', 'buddypress' ); ?></p>
787
798
function bp_activity_admin_edit_metabox_userid( $item ) {
799
?>
800
801
+ <label class="screen-reader-text" for="bp-activities-userid"><?php _e( 'Author ID', 'buddypress' ); ?></label>
802
<input type="number" name="bp-activities-userid" id="bp-activities-userid" value="<?php echo esc_attr( $item->user_id ); ?>" min="1" />
803
804
<?php
873
874
?>
875
876
+ <label for="bp-activities-type" class="screen-reader-text"><?php esc_html_e( 'Select activity type', 'buddypress' ); ?></label>
877
<select name="bp-activities-type" id="bp-activities-type">
878
<?php foreach ( $actions as $k => $v ) : ?>
879
<option value="<?php echo esc_attr( $k ); ?>" <?php selected( $k, $selected ); ?>><?php echo esc_html( $v ); ?></option>
1016
<form method="get" action="">
1017
1018
<h3 id="bp-replyhead"><?php _e( 'Reply to Activity', 'buddypress' ); ?></h3>
1019
<?php wp_editor( '', 'bp-activities', array( 'dfw' => false, 'media_buttons' => false, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ), 'tinymce' => false, ) ); ?>
1020
1021
<p id="bp-replysubmit" class="submit">
bp-activity/bp-activity-adminbar.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- /**
3
- * BuddyPress Activity Toolbar.
4
- *
5
- * Handles the activity functions related to the WordPress Toolbar.
6
- *
7
- * @package BuddyPress
8
- * @subpackage Activity
9
- */
10
-
11
- // Exit if accessed directly.
12
- defined( 'ABSPATH' ) || exit;
13
-
14
- /**
15
- * Add the Activity top-level menu link when viewing single activity item.
16
- *
17
- * @since 2.6.0
18
- *
19
- * @return null Null if user does not have access to editing functionality.
20
- */
21
- function bp_activity_admin_menu() {
22
- global $wp_admin_bar;
23
-
24
- // Only show if viewing a single activity item.
25
- if ( ! bp_is_single_activity() ) {
26
- return;
27
- }
28
-
29
- // Only show this menu to super admins
30
- if ( ! bp_current_user_can( 'bp_moderate' ) ) {
31
- return;
32
- }
33
-
34
- $activity_edit_link = add_query_arg( array(
35
- 'page' => 'bp-activity',
36
- 'aid' => bp_current_action(),
37
- 'action' => 'edit'
38
- ), bp_get_admin_url( 'admin.php' ) );
39
-
40
- // Add the top-level Edit Activity button.
41
- $wp_admin_bar->add_menu( array(
42
- 'id' => 'activity-admin',
43
- 'title' => __( 'Edit Activity', 'buddypress' ),
44
- 'href' => esc_url( $activity_edit_link ),
45
- ) );
46
- }
47
- add_action( 'admin_bar_menu', 'bp_activity_admin_menu', 99 );
bp-activity/bp-activity-akismet.php CHANGED
@@ -10,32 +10,7 @@
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
- *
20
- * @since 1.6.0
21
- * @since 2.3.0 We only support Akismet 3+.
22
- */
23
- function bp_activity_setup_akismet() {
24
- /**
25
- * Filters if BuddyPress Activity Akismet support has been disabled by another plugin.
26
- *
27
- * @since 1.6.0
28
- *
29
- * @param bool $value Return value of bp_is_akismet_active boolean function.
30
- */
31
- if ( ! apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) {
32
- return;
33
- }
34
-
35
- // Instantiate Akismet for BuddyPress.
36
- buddypress()->activity->akismet = new BP_Akismet();
37
- }
38
- add_action( 'bp_activity_setup_globals', 'bp_activity_setup_akismet' );
39
40
/**
41
* Delete old spam activity meta data.
10
// Exit if accessed directly.
11
defined( 'ABSPATH' ) || exit;
12
13
+ require dirname( __FILE__ ) . '/classes/class-bp-akismet.php';
14
15
/**
16
* Delete old spam activity meta data.
bp-activity/bp-activity-cache.php CHANGED
@@ -63,24 +63,3 @@ function bp_activity_clear_cache_for_deleted_activity( $deleted_ids ) {
63
}
64
}
65
add_action( 'bp_activity_deleted_activities', 'bp_activity_clear_cache_for_deleted_activity' );
66
-
67
- /**
68
- * Reset cache incrementor for the Activity component.
69
- *
70
- * Called whenever an activity item is created, updated, or deleted, this
71
- * function effectively invalidates all cached results of activity queries.
72
- *
73
- * @since 2.7.0
74
- *
75
- * @return bool True on success, false on failure.
76
- */
77
- function bp_activity_reset_cache_incrementor() {
78
- $without_last_activity = bp_core_reset_incrementor( 'bp_activity' );
79
- $with_last_activity = bp_core_reset_incrementor( 'bp_activity_with_last_activity' );
80
- return $without_last_activity && $with_last_activity;
81
- }
82
- add_action( 'bp_activity_delete', 'bp_activity_reset_cache_incrementor' );
83
- add_action( 'bp_activity_add', 'bp_activity_reset_cache_incrementor' );
84
- add_action( 'added_activity_meta', 'bp_activity_reset_cache_incrementor' );
85
- add_action( 'updated_activity_meta', 'bp_activity_reset_cache_incrementor' );
86
- add_action( 'deleted_activity_meta', 'bp_activity_reset_cache_incrementor' );
63
}
64
}
65
add_action( 'bp_activity_deleted_activities', 'bp_activity_clear_cache_for_deleted_activity' );
bp-activity/bp-activity-classes.php CHANGED
@@ -13,8 +13,3 @@ defined( 'ABSPATH' ) || exit;
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
- }
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';
bp-activity/bp-activity-embeds.php DELETED
@@ -1,352 +0,0 @@
1
- <?php
2
- /**
3
- * Functions related to embedding single activity items externally.
4
- *
5
- * Relies on WordPress 4.5.
6
- *
7
- * @since 2.6.0
8
- *
9
- * @package BuddyPress
10
- * @subpackage ActivityEmbeds
11
- */
12
-
13
- // Exit if accessed directly.
14
- defined( 'ABSPATH' ) || exit;
15
-
16
- /**
17
- * Loads our activity oEmbed component.
18
- *
19
- * @since 2.6.0
20
- */
21
- function bp_activity_setup_oembed() {
22
- if ( version_compare( $GLOBALS['wp_version'], '4.5', '>=' ) && bp_is_active( 'activity', 'embeds' ) ) {
23
- buddypress()->activity->oembed = new BP_Activity_oEmbed_Extension;
24
- }
25
- }
26
- add_action( 'bp_loaded', 'bp_activity_setup_oembed' );
27
-
28
- /**
29
- * Catch links in embed excerpt so top.location.href can be added.
30
- *
31
- * Due to <iframe sandbox="allow-top-navigation">, links in embeds can only be
32
- * clicked if invoked with top.location.href via JS.
33
- *
34
- * @since 2.6.0
35
- *
36
- * @param string $text Embed excerpt
37
- * @return string
38
- */
39
- function bp_activity_embed_excerpt_onclick_location_filter( $text ) {
40
- return preg_replace_callback( '/<a\s+[^>]*href=\"([^\"]*)\"/iU', 'bp_activity_embed_excerpt_onclick_location_filter_callback', $text );
41
- }
42
- /**
43
- * Add onclick="top.location.href" to a link.
44
- *
45
- * @since 2.6.0
46
- *
47
- * @param array $matches Items matched by bp_activity_embed_excerpt_onclick_location_filter().
48
- * @return string
49
- */
50
- function bp_activity_embed_excerpt_onclick_location_filter_callback( $matches ) {
51
- return sprintf( '<a href="%1$s" onclick="top.location.href=\'%1$s\'"', $matches[1] );
52
- }
53
-
54
- /**
55
- * Add inline styles for BP activity embeds.
56
- *
57
- * @since 2.6.0
58
- */
59
- function bp_activity_embed_add_inline_styles() {
60
- if ( false === bp_is_single_activity() ) {
61
- return;
62
- }
63
-
64
- $min = bp_core_get_minified_asset_suffix();
65
-
66
- if ( is_rtl() ) {
67
- $css = bp_locate_template_asset( "css/embeds-activity-rtl{$min}.css" );
68
- } else {
69
- $css = bp_locate_template_asset( "css/embeds-activity{$min}.css" );
70
- }
71
-
72
- // Bail if file wasn't found.
73
- if ( false === $css ) {
74
- return;
75
- }
76
-
77
- // Grab contents of CSS file and do some rudimentary CSS protection.
78
- $css = file_get_contents( $css['file'] );
79
- $css = wp_kses( $css, array( "\'", '\"' ) );
80
-
81
- printf( '<style type="text/css">%s</style>', $css );
82
- }
83
- add_action( 'embed_head', 'bp_activity_embed_add_inline_styles', 20 );
84
-
85
- /**
86
- * Query for the activity item on the activity embed template.
87
- *
88
- * Basically a wrapper for {@link bp_has_activities()}, but allows us to
89
- * use the activity loop without requerying for it again.
90
- *
91
- * @since 2.6.0
92
- *
93
- * @param int $activity_id The activity ID.
94
- * @return bool
95
- */
96
- function bp_activity_embed_has_activity( $activity_id = 0 ) {
97
- global $activities_template;
98
-
99
- if ( empty( $activity_id ) ) {
100
- return false;
101
- }
102
-
103
- if ( ! empty( $activities_template->activities ) ) {
104
- $activity = (array) $activities_template->activities;
105
- $activity = reset( $activity );
106
-
107
- // No need to requery if we already got the embed activity
108
- if ( (int) $activity_id === $activity->id ) {
109
- return $activities_template->has_activities();
110
- }
111
- }
112
-
113
- return bp_has_activities( array(
114
- 'display_comments' => 'threaded',
115
- 'show_hidden' => true,
116
- 'include' => (int) $activity_id,
117
- ) );
118
- }
119
-
120
- /**
121
- * Outputs excerpt for an activity embed item.
122
- *
123
- * @since 2.6.0
124
- */
125
- function bp_activity_embed_excerpt( $content = '' ) {
126
- echo bp_activity_get_embed_excerpt( $content = '' );
127
- }
128
-
129
- /**
130
- * Generates excerpt for an activity embed item.
131
- *
132
- * @since 2.6.0
133
- *
134
- * @param string $content The content to generate an excerpt for.
135
- * @return string
136
- */
137
- function bp_activity_get_embed_excerpt( $content = '' ) {
138
- if ( empty( $content ) && ! empty( $GLOBALS['activities_template']->in_the_loop ) ) {
139
- $content = $GLOBALS['activities_template']->activity->content;
140
- }
141
-
142
- /*
143
- * bp_activity_truncate_entry() includes the 'Read More' link, which is why
144
- * we're using this instead of bp_create_excerpt().
145
- */
146
- $content = html_entity_decode( $content );
147
- $content = bp_activity_truncate_entry( $content, array(
148
- 'html' => false,
149
- 'filter_shortcodes' => true,
150
- 'strip_tags' => true,
151
- 'force_truncate' => true
152
- ) );
153
-
154
- /**
155
- * Filter the activity embed excerpt.
156
- *
157
- * @since 2.6.0
158
- *
159
- * @var string $content Embed Excerpt.
160
- * @var string $unmodified_content Unmodified activity content.
161
- */
162
- return apply_filters( 'bp_activity_get_embed_excerpt', $content, $GLOBALS['activities_template']->activity->content );
163
- }
164
-
165
- /**
166
- * Outputs the first embedded item in the activity oEmbed template.
167
- *
168
- * @since 2.6.0
169
- */
170
- function bp_activity_embed_media() {
171
- // Bail if oEmbed request explicitly hides media.
172
- if ( isset( $_GET['hide_media'] ) && true == wp_validate_boolean( $_GET['hide_media'] ) ) {
173
- /**
174
- * Do something after media is rendered for an activity oEmbed item.
175
- *
176
- * @since 2.6.0
177
- */
178
- do_action( 'bp_activity_embed_after_media' );
179
-
180
- return;
181
- }
182
-
183
- /**
184
- * Should we display media in the oEmbed template?
185
- *
186
- * @since 2.6.0
187
- *
188
- * @param bool $retval Defaults to true.
189
- */
190
- $allow_media = apply_filters( 'bp_activity_embed_display_media', true );
191
-
192
- // Find oEmbeds from only WP registered providers.
193
- bp_remove_all_filters( 'oembed_providers' );
194
- $media = bp_core_extract_media_from_content( $GLOBALS['activities_template']->activity->content, 'embeds' );
195
- bp_restore_all_filters( 'oembed_providers' );
196
-
197
- // oEmbeds have precedence over inline video / audio.
198
- if ( isset( $media['embeds'] ) && true === $allow_media ) {
199
- // Autoembed first URL.
200
- $oembed_defaults = wp_embed_defaults();
201
- $oembed_args = array(
202
- 'width' => $oembed_defaults['width'],
203
- 'height' => $oembed_defaults['height'],
204
- 'discover' => true
205
- );
206
- $url = $media['embeds'][0]['url'];
207
- $cachekey = '_oembed_response_' . md5( $url . serialize( $oembed_args ) );
208
-
209
- // Try to fetch oEmbed response from meta.
210
- $oembed = bp_activity_get_meta( bp_get_activity_id(), $cachekey );
211
-
212
- // No cache, so fetch full oEmbed response now!
213
- if ( '' === $oembed ) {
214
- $o = _wp_oembed_get_object();
215
- $oembed = $o->fetch( $o->get_provider( $url, $oembed_args ), $url, $oembed_args );
216
-
217
- // Cache oEmbed response.
218
- bp_activity_update_meta( bp_get_activity_id(), $cachekey, $oembed );
219
- }
220
-
221
- $content = '';
222
-
223
- /**
224
- * Filters the default embed display max width.
225
- *
226
- * This is used if the oEmbed response does not return a thumbnail width.
227
- *
228
- * @since 2.6.0
229
- *
230
- * @param int $width.
231
- */
232
- $width = (int) apply_filters( 'bp_activity_embed_display_media_width', 550 );
233
-
234
- // Set thumbnail.
235
- if ( 'photo' === $oembed->type ) {
236
- $thumbnail = $oembed->url;
237
- } elseif ( isset( $oembed->thumbnail_url ) ) {
238
- $thumbnail = $oembed->thumbnail_url;
239
-
240
- /* Non-oEmbed standard attributes */
241
- // Mixcloud
242
- } elseif ( isset( $oembed->image ) ) {
243
- $thumbnail = $oembed->image;
244
- // ReverbNation
245
- } elseif ( isset( $oembed->{'thumbnail-url'} ) ) {
246
- $thumbnail = $oembed->{'thumbnail-url'};
247
- }
248
-
249
- // Display thumb and related oEmbed meta.
250
- if ( true === isset ( $thumbnail ) ) {
251
- $play_icon = $caption = '';
252
-
253
- // Add play icon for non-photos.
254
- if ( 'photo' !== $oembed->type ) {
255
- /**
256
- * ion-play icon from Ionicons.
257
- *
258
- * @link http://ionicons.com/
259
- * @license MIT
260
- */
261
- $play_icon = <<<EOD
262
- <svg id="Layer_1" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M405.2,232.9L126.8,67.2c-3.4-2-6.9-3.2-10.9-3.2c-10.9,0-19.8,9-19.8,20H96v344h0.1c0,11,8.9,20,19.8,20 c4.1,0,7.5-1.4,11.2-3.4l278.1-165.5c6.6-5.5,10.8-13.8,10.8-23.1C416,246.7,411.8,238.5,405.2,232.9z"/></svg>
263
- EOD;
264
-
265
- $play_icon = sprintf( '<a rel="nofollow" class="play-btn" href="%1$s" onclick="top.location.href=\'%1$s\'">%2$s</a>', esc_url( $url ), $play_icon );
266
- }
267
-
268
- // Thumb width
269
- $thumb_width = isset( $oembed->thumbnail_width ) && 'photo' !== $oembed->type && (int) $oembed->thumbnail_width < 550 ? (int) $oembed->thumbnail_width : $width;
270
-
271
- $float_width = 350;
272
-
273
- // Set up thumb.
274
- $content = sprintf( '<div class="thumb" style="max-width:%1$spx">%2$s<a href="%3$s" rel="nofollow" onclick="top.location.href=\'%3$s\'"><img src="%4$s" /></a></div>', $thumb_width, $play_icon, esc_url( $url ), esc_url( $thumbnail ) );
275
-
276
- // Show title.
277
- if ( isset( $oembed->title ) ) {
278
- $caption .= sprintf( '<p class="caption-title"><strong>%s</strong></p>', apply_filters( 'single_post_title', $oembed->title ) );
279
- }
280
-
281
- // Show description (non-oEmbed standard)
282
- if ( isset( $oembed->description ) ) {
283
- $caption .= sprintf( '<div class="caption-description">%s</div>', apply_filters( 'bp_activity_get_embed_excerpt', $oembed->description ) );
284
- }
285
-
286
- // Show author info.
287
- if ( isset( $oembed->provider_name ) && isset( $oembed->author_name ) ) {
288
- /* translators: By [oEmbed author] on [oEmbed provider]. eg. By BuddyPress on YouTube. */
289
- $anchor_text = sprintf( __( 'By %1$s on %2$s', 'buddypress' ), $oembed->author_name, $oembed->provider_name );
290
-
291
- } elseif ( isset( $oembed->provider_name ) ) {
292
- $anchor_text = sprintf( __( 'View on %s', 'buddypress' ), $oembed->provider_name );
293
- }
294
-
295
- if ( true === isset( $anchor_text ) ) {
296
- $caption .= sprintf( '<a rel="nofollow" href="%1$s" onclick="top.location.href=\'%1$s\'">%2$s</a>', esc_url( $url ), apply_filters( 'the_title', $anchor_text ) );
297
- }
298
-
299
- // Set up caption.
300
- if ( '' !== $caption ) {
301
- $css_class = isset( $oembed->provider_name ) ? sprintf( ' provider-%s', sanitize_html_class( strtolower( $oembed->provider_name ) ) ) : '';
302
- $caption = sprintf( '<div class="caption%1$s" style="width:%2$s">%3$s</div>',
303
- $css_class,
304
- $thumb_width > $float_width ? 100 . '%' : round( ( $width - (int) $thumb_width ) / $width * 100 ) . '%',
305
- $caption
306
- );
307
-
308
- $content .= $caption;
309
- }
310
- }
311
-
312
- // Print rich content.
313
- if ( '' !== $content ) {
314
- printf( '<div class="bp-activity-embed-display-media %s" style="max-width:%spx">%s</div>',
315
- $thumb_width < $float_width ? 'two-col' : 'one-col',
316
- $thumb_width < $float_width ? $width : $thumb_width,
317
- $content
318
- );
319
- }
320
-
321
- // Video / audio.
322
- } elseif ( true === $allow_media ) {
323
- // Call BP_Embed if it hasn't already loaded.
324
- bp_embed_init();
325
-
326
- // Run shortcode and embed routine.
327
- $content = buddypress()->embed->run_shortcode( $GLOBALS['activities_template']->activity->content );
328
- $content = buddypress()->embed->autoembed( $content );
329
-
330
- // Try to find inline video / audio.
331
- $media = bp_core_extract_media_from_content( $content, 96 );
332
-
333
- // Video takes precedence. HTML5-only.
334
- if ( isset( $media['videos'] ) && 'shortcodes' === $media['videos'][0]['source'] ) {
335
- printf( '<video controls preload="metadata"><source src="%1$s"><p>%2$s</p></video>',
336
- esc_url( $media['videos'][0]['url'] ),
337
- esc_html__( 'Your browser does not support HTML5 video', 'buddypress' )
338
- );
339
-
340
- // No video? Try audio. HTML5-only.
341
- } elseif ( isset( $media['audio'] ) && 'shortcodes' === $media['audio'][0]['source'] ) {
342
- printf( '<audio controls preload="metadata"><source src="%1$s"><p>%2$s</p></audio>',
343
- esc_url( $media['audio'][0]['url'] ),
344
- esc_html__( 'Your browser does not support HTML5 audio', 'buddypress' )
345
- );
346
- }
347
-
348
- }
349
-
350
- /** This hook is documented in /bp-activity/bp-activity-embeds.php */
351
- do_action( 'bp_activity_embed_after_media' );
352
- }
bp-activity/bp-activity-filters.php CHANGED
@@ -43,7 +43,6 @@ add_filter( 'bp_get_activity_content', 'wptexturize' );
43
add_filter( 'bp_get_activity_parent_content', 'wptexturize' );
44
add_filter( 'bp_get_activity_latest_update', 'wptexturize' );
45
add_filter( 'bp_get_activity_latest_update_excerpt', 'wptexturize' );
46
- add_filter( 'bp_activity_get_embed_excerpt', 'wptexturize' );
47
48
add_filter( 'bp_get_activity_action', 'convert_smilies' );
49
add_filter( 'bp_get_activity_content_body', 'convert_smilies' );
@@ -51,7 +50,6 @@ add_filter( 'bp_get_activity_content', 'convert_smilies' );
51
add_filter( 'bp_get_activity_parent_content', 'convert_smilies' );
52
add_filter( 'bp_get_activity_latest_update', 'convert_smilies' );
53
add_filter( 'bp_get_activity_latest_update_excerpt', 'convert_smilies' );
54
- add_filter( 'bp_activity_get_embed_excerpt', 'convert_smilies' );
55
56
add_filter( 'bp_get_activity_action', 'convert_chars' );
57
add_filter( 'bp_get_activity_content_body', 'convert_chars' );
@@ -59,13 +57,11 @@ add_filter( 'bp_get_activity_content', 'convert_chars' );
59
add_filter( 'bp_get_activity_parent_content', 'convert_chars' );
60
add_filter( 'bp_get_activity_latest_update', 'convert_chars' );
61
add_filter( 'bp_get_activity_latest_update_excerpt', 'convert_chars' );
62
- add_filter( 'bp_activity_get_embed_excerpt', 'convert_chars' );
63
64
add_filter( 'bp_get_activity_action', 'wpautop' );
65
add_filter( 'bp_get_activity_content_body', 'wpautop' );
66
add_filter( 'bp_get_activity_content', 'wpautop' );
67
add_filter( 'bp_get_activity_feed_item_description', 'wpautop' );
68
- add_filter( 'bp_activity_get_embed_excerpt', 'wpautop' );
69
70
add_filter( 'bp_get_activity_action', 'make_clickable', 9 );
71
add_filter( 'bp_get_activity_content_body', 'make_clickable', 9 );
@@ -74,7 +70,6 @@ add_filter( 'bp_get_activity_parent_content', 'make_clickable', 9 );
74
add_filter( 'bp_get_activity_latest_update', 'make_clickable', 9 );
75
add_filter( 'bp_get_activity_latest_update_excerpt', 'make_clickable', 9 );
76
add_filter( 'bp_get_activity_feed_item_description', 'make_clickable', 9 );
77
- add_filter( 'bp_activity_get_embed_excerpt', 'make_clickable', 9 );
78
79
add_filter( 'bp_acomment_name', 'stripslashes_deep', 5 );
80
add_filter( 'bp_get_activity_action', 'stripslashes_deep', 5 );
@@ -99,7 +94,6 @@ add_filter( 'pre_comment_content', 'bp_activity_at_name_filter
99
add_filter( 'group_forum_topic_text_before_save', 'bp_activity_at_name_filter' );
100
add_filter( 'group_forum_post_text_before_save', 'bp_activity_at_name_filter' );
101
add_filter( 'the_content', 'bp_activity_at_name_filter' );
102
- add_filter( 'bp_activity_get_embed_excerpt', 'bp_activity_at_name_filter' );
103
104
add_filter( 'bp_get_activity_parent_content', 'bp_create_excerpt' );
105
@@ -109,8 +103,6 @@ add_filter( 'bp_get_activity_content', 'bp_activity_truncate_entry', 5 );
109
add_filter( 'bp_get_total_favorite_count_for_user', 'bp_core_number_format' );
110
add_filter( 'bp_get_total_mention_count_for_user', 'bp_core_number_format' );
111
112
- add_filter( 'bp_activity_get_embed_excerpt', 'bp_activity_embed_excerpt_onclick_location_filter', 9 );
113
-
114
/* Actions *******************************************************************/
115
116
// At-name filter.
@@ -155,19 +147,13 @@ function bp_activity_get_moderated_activity_types() {
155
function bp_activity_check_moderation_keys( $activity ) {
156
157
// Only check specific types of activity updates.
158
- if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) ) {
159
return;
160
- }
161
162
- // Send back the error so activity update fails.
163
// @todo This is temporary until some kind of moderation is built.
164
- $moderate = bp_core_check_for_moderation( $activity->user_id, '', $activity->content, 'wp_error' );
165
- if ( is_wp_error( $moderate ) ) {
166
- $activity->errors = $moderate;
167
-
168
- // Backpat.
169
$activity->component = false;
170
- }
171
}
172
173
/**
@@ -180,19 +166,12 @@ function bp_activity_check_moderation_keys( $activity ) {
180
function bp_activity_check_blacklist_keys( $activity ) {
181
182
// Only check specific types of activity updates.
183
- if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) ) {
184
return;
185
- }
186
187
- // Send back the error so activity update fails.
188
- // @todo This is temporary until some kind of trash status is built.
189
- $blacklist = bp_core_check_for_blacklist( $activity->user_id, '', $activity->content, 'wp_error' );
190
- if ( is_wp_error( $blacklist ) ) {
191
- $activity->errors = $blacklist;
192
-
193
- // Backpat.
194
- $activity->component = false;
195
- }
196
}
197
198
/**
@@ -200,6 +179,9 @@ function bp_activity_check_blacklist_keys( $activity ) {
200
*
201
* @since 1.1.0
202
*
203
* @param string $content The activity content.
204
* @return string $content Filtered activity content.
205
*/
@@ -207,15 +189,13 @@ function bp_activity_filter_kses( $content ) {
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();
217
- $activity_allowedtags['i'] = array();
218
-
219
$activity_allowedtags['img'] = array();
220
$activity_allowedtags['img']['src'] = array();
221
$activity_allowedtags['img']['alt'] = array();
@@ -224,10 +204,8 @@ function bp_activity_filter_kses( $content ) {
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
/**
@@ -282,7 +260,7 @@ function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
282
283
// Linkify the mentions with the username.
284
foreach ( (array) $usernames as $user_id => $username ) {
285
- $content = preg_replace( '/(@' . $username . '\b)/', "<a class='bp-suggestions-mention' href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $content );
286
}
287
288
// Put everything back.
@@ -304,6 +282,8 @@ function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
304
*
305
* @since 1.5.0
306
*
307
* @param BP_Activity_Activity $activity Activity Object.
308
*/
309
function bp_activity_at_name_filter_updates( $activity ) {
@@ -323,7 +303,7 @@ function bp_activity_at_name_filter_updates( $activity ) {
323
if ( ! empty( $usernames ) ) {
324
// Replace @mention text with userlinks.
325
foreach( (array) $usernames as $user_id => $username ) {
326
- $activity->content = preg_replace( '/(@' . $username . '\b)/', "<a class='bp-suggestions-mention' href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $activity->content );
327
}
328
329
// Add our hook to send @mention emails after the activity item is saved.
@@ -339,6 +319,9 @@ function bp_activity_at_name_filter_updates( $activity ) {
339
*
340
* @since 1.7.0
341
*
342
* @param BP_Activity_Activity $activity The BP_Activity_Activity object.
343
*/
344
function bp_activity_at_name_send_emails( $activity ) {
@@ -412,16 +395,19 @@ function bp_activity_make_nofollow_filter( $text ) {
412
* This method can only be used inside the Activity loop.
413
*
414
* @since 1.5.0
415
- * @since 2.6.0 Added $args parameter.
416
*
417
* @param string $text The original activity entry text.
418
- * @param array $args {
419
- * Optional parameters. See $options argument of {@link bp_create_excerpt()}
420
- * for all available parameters.
421
- * }
422
* @return string $excerpt The truncated text.
423
*/
424
- function bp_activity_truncate_entry( $text, $args = array() ) {
425
global $activities_template;
426
427
/**
@@ -437,7 +423,7 @@ function bp_activity_truncate_entry( $text, $args = array() ) {
437
);
438
439
// The full text of the activity update should always show on the single activity screen.
440
- if ( empty( $args['force_truncate'] ) && ( ! $maybe_truncate_text || bp_is_single_activity() ) ) {
441
return $text;
442
}
443
@@ -459,17 +445,15 @@ function bp_activity_truncate_entry( $text, $args = array() ) {
459
*/
460
$excerpt_length = apply_filters( 'bp_activity_excerpt_length', 358 );
461
462
- $args = wp_parse_args( $args, array( 'ending' => __( '&hellip;', 'buddypress' ) ) );
463
-
464
// Run the text through the excerpt function. If it's too short, the original text will be returned.
465
- $excerpt = bp_create_excerpt( $text, $excerpt_length, $args );
466
467
/*
468
* If the text returned by bp_create_excerpt() is different from the original text (ie it's
469
* been truncated), add the "Read More" link. Note that bp_create_excerpt() is stripping
470
* shortcodes, so we have strip them from the $text before the comparison.
471
*/
472
- if ( strlen( $excerpt ) < strlen( strip_shortcodes( $text ) ) ) {
473
$id = !empty( $activities_template->activity->current_comment->id ) ? 'acomment-read-more-' . $activities_template->activity->current_comment->id : 'activity-read-more-' . bp_get_activity_id();
474
475
$excerpt = sprintf( '%1$s<span class="activity-read-more" id="%2$s"><a href="%3$s" rel="nofollow">%4$s</a></span>', $excerpt, $id, bp_get_activity_thread_permalink(), $append_text );
@@ -492,6 +476,8 @@ function bp_activity_truncate_entry( $text, $args = array() ) {
492
*
493
* @since 2.0.0
494
*
495
* @param array $js_handles The original dependencies.
496
* @return array $js_handles The new dependencies.
497
*/
@@ -557,6 +543,8 @@ add_filter( 'bp_get_activity_css_class', 'bp_activity_timestamp_class', 9, 1 );
557
*
558
* @since 2.0.0
559
*
560
* @param array $response Array containing Heartbeat API response.
561
* @param array $data Array containing data for Heartbeat API response.
562
* @return array $response
43
add_filter( 'bp_get_activity_parent_content', 'wptexturize' );
44
add_filter( 'bp_get_activity_latest_update', 'wptexturize' );
45
add_filter( 'bp_get_activity_latest_update_excerpt', 'wptexturize' );
46
47
add_filter( 'bp_get_activity_action', 'convert_smilies' );
48
add_filter( 'bp_get_activity_content_body', 'convert_smilies' );
50
add_filter( 'bp_get_activity_parent_content', 'convert_smilies' );
51
add_filter( 'bp_get_activity_latest_update', 'convert_smilies' );
52
add_filter( 'bp_get_activity_latest_update_excerpt', 'convert_smilies' );
53
54
add_filter( 'bp_get_activity_action', 'convert_chars' );
55
add_filter( 'bp_get_activity_content_body', 'convert_chars' );
57
add_filter( 'bp_get_activity_parent_content', 'convert_chars' );
58
add_filter( 'bp_get_activity_latest_update', 'convert_chars' );
59
add_filter( 'bp_get_activity_latest_update_excerpt', 'convert_chars' );
60
61
add_filter( 'bp_get_activity_action', 'wpautop' );
62
add_filter( 'bp_get_activity_content_body', 'wpautop' );
63
add_filter( 'bp_get_activity_content', 'wpautop' );
64
add_filter( 'bp_get_activity_feed_item_description', 'wpautop' );
65
66
add_filter( 'bp_get_activity_action', 'make_clickable', 9 );
67
add_filter( 'bp_get_activity_content_body', 'make_clickable', 9 );
70
add_filter( 'bp_get_activity_latest_update', 'make_clickable', 9 );
71
add_filter( 'bp_get_activity_latest_update_excerpt', 'make_clickable', 9 );
72
add_filter( 'bp_get_activity_feed_item_description', 'make_clickable', 9 );
73
74
add_filter( 'bp_acomment_name', 'stripslashes_deep', 5 );
75
add_filter( 'bp_get_activity_action', 'stripslashes_deep', 5 );
94
add_filter( 'group_forum_topic_text_before_save', 'bp_activity_at_name_filter' );
95
add_filter( 'group_forum_post_text_before_save', 'bp_activity_at_name_filter' );
96
add_filter( 'the_content', 'bp_activity_at_name_filter' );
97
98
add_filter( 'bp_get_activity_parent_content', 'bp_create_excerpt' );
99
103
add_filter( 'bp_get_total_favorite_count_for_user', 'bp_core_number_format' );
104
add_filter( 'bp_get_total_mention_count_for_user', 'bp_core_number_format' );
105
106
/* Actions *******************************************************************/
107
108
// At-name filter.
147
function bp_activity_check_moderation_keys( $activity ) {
148
149
// Only check specific types of activity updates.
150
+ if ( !in_array( $activity->type, bp_activity_get_moderated_activity_types() ) )
151
return;
152
153
+ // Unset the activity component so activity stream update fails
154
// @todo This is temporary until some kind of moderation is built.
155
+ if ( !bp_core_check_for_moderation( $activity->user_id, '', $activity->content ) )
156
$activity->component = false;
157
}
158
159
/**
166
function bp_activity_check_blacklist_keys( $activity ) {
167
168
// Only check specific types of activity updates.
169
+ if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) )
170
return;
171
172
+ // Mark as spam.
173
+ if ( ! bp_core_check_for_blacklist( $activity->user_id, '', $activity->content ) )
174
+ bp_activity_mark_as_spam( $activity, 'by_blacklist' );
175
}
176
177
/**
179
*
180
* @since 1.1.0
181
*
182
+ * @uses apply_filters() To call the 'bp_activity_allowed_tags' hook.
183
+ * @uses wp_kses()
184
+ *
185
* @param string $content The activity content.
186
* @return string $content Filtered activity content.
187
*/
189
global $allowedtags;
190
191
$activity_allowedtags = $allowedtags;
192
+ $activity_allowedtags['a']['class'] = array();
193
+ $activity_allowedtags['a']['id'] = array();
194
+ $activity_allowedtags['a']['rel'] = array();
195
+ $activity_allowedtags['a']['title'] = array();
196
+ $activity_allowedtags['b'] = array();
197
+ $activity_allowedtags['code'] = array();
198
+ $activity_allowedtags['i'] = array();
199
$activity_allowedtags['img'] = array();
200
$activity_allowedtags['img']['src'] = array();
201
$activity_allowedtags['img']['alt'] = array();
204
$activity_allowedtags['img']['class'] = array();
205
$activity_allowedtags['img']['id'] = array();
206
$activity_allowedtags['img']['title'] = array();
207
+ $activity_allowedtags['span'] = array();
208
+ $activity_allowedtags['span']['class'] = array();
209
210
211
/**
260
261
// Linkify the mentions with the username.
262
foreach ( (array) $usernames as $user_id => $username ) {
263
+ $content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $content );
264
}
265
266
// Put everything back.
282
*
283
* @since 1.5.0
284
*
285
+ * @uses bp_activity_find_mentions()
286
+ *
287
* @param BP_Activity_Activity $activity Activity Object.
288
*/
289
function bp_activity_at_name_filter_updates( $activity ) {
303
if ( ! empty( $usernames ) ) {
304
// Replace @mention text with userlinks.
305
foreach( (array) $usernames as $user_id => $username ) {
306
+ $activity->content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $activity->content );
307
}
308
309
// Add our hook to send @mention emails after the activity item is saved.
319
*
320
* @since 1.7.0
321
*
322
+ * @uses bp_activity_at_message_notification()
323
+ * @uses bp_activity_update_mention_count_for_user()
324
+ *
325
* @param BP_Activity_Activity $activity The BP_Activity_Activity object.
326
*/
327
function bp_activity_at_name_send_emails( $activity ) {
395
* This method can only be used inside the Activity loop.
396
*
397
* @since 1.5.0
398
+ *
399
+ * @uses bp_is_single_activity()
400
+ * @uses apply_filters() To call the 'bp_activity_excerpt_append_text' hook.
401
+ * @uses apply_filters() To call the 'bp_activity_excerpt_length' hook.
402
+ * @uses bp_create_excerpt()
403
+ * @uses bp_get_activity_id()
404
+ * @uses bp_get_activity_thread_permalink()
405
+ * @uses apply_filters() To call the 'bp_activity_truncate_entry' hook.
406
*
407
* @param string $text The original activity entry text.
408
* @return string $excerpt The truncated text.
409
*/
410
+ function bp_activity_truncate_entry( $text ) {
411
global $activities_template;
412
413
/**
423
);
424
425
// The full text of the activity update should always show on the single activity screen.
426
+ if ( ! $maybe_truncate_text || bp_is_single_activity() ) {
427
return $text;
428
}
429
445
*/
446
$excerpt_length = apply_filters( 'bp_activity_excerpt_length', 358 );
447
448
// Run the text through the excerpt function. If it's too short, the original text will be returned.
449
+ $excerpt = bp_create_excerpt( $text, $excerpt_length, array( 'ending' => __( '&hellip;', 'buddypress' ) ) );
450
451
/*
452
* If the text returned by bp_create_excerpt() is different from the original text (ie it's
453
* been truncated), add the "Read More" link. Note that bp_create_excerpt() is stripping
454
* shortcodes, so we have strip them from the $text before the comparison.
455
*/
456
+ if ( $excerpt != strip_shortcodes( $text ) ) {
457
$id = !empty( $activities_template->activity->current_comment->id ) ? 'acomment-read-more-' . $activities_template->activity->current_comment->id : 'activity-read-more-' . bp_get_activity_id();
458
459
$excerpt = sprintf( '%1$s<span class="activity-read-more" id="%2$s"><a href="%3$s" rel="nofollow">%4$s</a></span>', $excerpt, $id, bp_get_activity_thread_permalink(), $append_text );
476
*
477
* @since 2.0.0
478
*
479
+ * @uses bp_activity_do_heartbeat() to check if heartbeat is required.
480
+ *
481
* @param array $js_handles The original dependencies.
482
* @return array $js_handles The new dependencies.
483
*/
543
*
544
* @since 2.0.0
545
*
546
+ * @uses bp_activity_get_last_updated() to get the recorded date of the last activity.
547
+ *
548
* @param array $response Array containing Heartbeat API response.
549
* @param array $data Array containing data for Heartbeat API response.
550
* @return array $response
bp-activity/bp-activity-functions.php CHANGED
@@ -40,6 +40,8 @@ function bp_activity_has_directory() {
40
*
41