Version Description
See: https://codex.buddypress.org/releases/version-2-7-4/
Download this release
Release Info
Developer | DJPaul |
Plugin | ![]() |
Version | 2.7.4 |
Comparing to | |
See all releases |
Code changes from version 2.6.3 to 2.7.4
- bp-activity/bp-activity-actions.php +1 -40
- bp-activity/bp-activity-akismet.php +23 -0
- bp-activity/bp-activity-cache.php +21 -0
- bp-activity/bp-activity-filters.php +15 -11
- bp-activity/bp-activity-functions.php +232 -52
- bp-activity/bp-activity-loader.php +1 -1
- bp-activity/bp-activity-notifications.php +23 -225
- bp-activity/bp-activity-screens.php +1 -1
- bp-activity/bp-activity-template.php +11 -11
- bp-activity/classes/class-bp-activity-activity.php +24 -2
- bp-activity/classes/class-bp-activity-component.php +11 -16
- bp-activity/classes/class-bp-activity-list-table.php +20 -2
- bp-activity/js/mentions.min.js +1 -1
- bp-blogs/bp-blogs-activity.php +1 -1
- bp-blogs/bp-blogs-filters.php +14 -0
- bp-blogs/bp-blogs-functions.php +20 -0
- bp-blogs/bp-blogs-loader.php +2 -0
- bp-blogs/bp-blogs-template.php +97 -22
- bp-blogs/classes/class-bp-blogs-blog.php +33 -10
- bp-blogs/classes/class-bp-blogs-component.php +6 -1
- bp-core/admin/bp-core-admin-components.php +1 -0
- bp-core/admin/bp-core-admin-functions.php +233 -0
- bp-core/admin/bp-core-admin-schema.php +13 -26
- bp-core/admin/bp-core-admin-slugs.php +11 -3
- bp-core/admin/bp-core-admin-tools.php +20 -29
- bp-core/admin/css/common-rtl.css +220 -79
- bp-core/admin/css/common-rtl.min.css +1 -1
- bp-core/admin/css/common.css +220 -79
- bp-core/admin/css/common.min.css +1 -1
- bp-core/admin/images/activity-embeds.png +0 -0
- bp-core/admin/images/default-themes.png +0 -0
- bp-core/admin/images/group-type-pop.png +0 -0
- bp-core/admin/images/new-nav-api.png +0 -0
- bp-core/admin/images/user-frontpage.png +0 -0
- bp-core/admin/js/dismissible-admin-notices.js +16 -0
- bp-core/admin/js/dismissible-admin-notices.min.js +1 -0
- bp-core/bp-core-actions.php +11 -4
- bp-core/bp-core-admin.php +27 -19
- bp-core/bp-core-attachments.php +8 -6
- bp-core/bp-core-avatars.php +24 -32
- bp-core/bp-core-buddybar.php +11 -11
- bp-core/bp-core-cache.php +107 -0
- bp-core/bp-core-caps.php +65 -20
- bp-core/bp-core-catchuri.php +71 -20
- bp-core/bp-core-classes.php +1 -0
- bp-core/bp-core-cssjs.php +145 -20
- bp-core/bp-core-customizer-email.php +3 -5
- bp-core/bp-core-dependency.php +0 -27
- bp-core/bp-core-filters.php +53 -43
- bp-core/bp-core-functions.php +405 -52
- bp-core/bp-core-loader.php +1 -3
- bp-core/bp-core-options.php +21 -61
- bp-core/bp-core-taxonomy.php +113 -5
- bp-core/bp-core-template-loader.php +5 -1
- bp-core/bp-core-template.php +77 -8
- bp-core/bp-core-theme-compatibility.php +11 -9
- bp-core/bp-core-update.php +109 -24
- bp-core/bp-core-wpabstraction.php +0 -7
- bp-core/classes/class-bp-admin.php +140 -97
- bp-core/classes/class-bp-attachment-avatar.php +1 -4
- bp-core/classes/class-bp-attachment.php +12 -12
- bp-core/classes/class-bp-button.php +231 -76
- bp-core/classes/class-bp-core-html-element.php +127 -0
- bp-core/classes/class-bp-core-nav.php +15 -15
- bp-core/classes/class-bp-core-oembed-extension.php +21 -15
- bp-core/classes/class-bp-core-user.php +17 -0
- bp-core/classes/class-bp-theme-compat.php +1 -1
- bp-core/classes/class-bp-user-query.php +11 -4
- bp-core/css/admin-bar-rtl.css +13 -0
- bp-core/css/admin-bar-rtl.min.css +1 -1
- bp-core/css/admin-bar.css +13 -0
- bp-core/css/admin-bar.min.css +1 -1
- bp-core/css/avatar-rtl.css +15 -1
- bp-core/css/avatar-rtl.min.css +1 -1
- bp-core/css/avatar.css +15 -1
- bp-core/css/avatar.min.css +1 -1
- bp-core/deprecated/2.7.php +26 -0
- bp-core/js/bp-plupload.min.js +1 -1
- bp-core/js/confirm.min.js +1 -1
- bp-core/js/jquery.atwho.min.js +0 -1
- bp-core/js/{jquery-cookie.js → vendor/jquery-cookie.js} +0 -0
- bp-core/js/{jquery-cookie.min.js → vendor/jquery-cookie.min.js} +1 -1
- bp-core/js/{jquery-scroll-to.js → vendor/jquery-scroll-to.js} +0 -0
- bp-core/js/{jquery-scroll-to.min.js → vendor/jquery-scroll-to.min.js} +1 -1
- bp-core/js/{jquery.atwho.js → vendor/jquery.atwho.js} +0 -0
- bp-core/js/vendor/jquery.atwho.min.js +1 -0
- bp-core/js/{jquery.atwho.txt → vendor/jquery.atwho.txt} +0 -0
- bp-core/js/{jquery.caret.js → vendor/jquery.caret.js} +0 -0
- bp-core/js/{jquery.caret.min.js → vendor/jquery.caret.min.js} +1 -1
- bp-core/js/{jquery.caret.txt → vendor/jquery.caret.txt} +0 -0
- bp-core/js/vendor/livestamp.js +129 -0
- bp-core/js/vendor/livestamp.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/af.js +73 -0
- bp-core/js/vendor/moment-js/locale/af.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ar-ly.js +122 -0
- bp-core/js/vendor/moment-js/locale/ar-ly.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ar-ma.js +60 -0
- bp-core/js/vendor/moment-js/locale/ar-ma.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ar-sa.js +104 -0
- bp-core/js/vendor/moment-js/locale/ar-sa.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ar-tn.js +59 -0
- bp-core/js/vendor/moment-js/locale/ar-tn.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ar.js +137 -0
- bp-core/js/vendor/moment-js/locale/ar.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/az.js +105 -0
- bp-core/js/vendor/moment-js/locale/az.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/be.js +134 -0
- bp-core/js/vendor/moment-js/locale/be.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/bg.js +90 -0
- bp-core/js/vendor/moment-js/locale/bg.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/bn.js +119 -0
- bp-core/js/vendor/moment-js/locale/bn.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/bo.js +119 -0
- bp-core/js/vendor/moment-js/locale/bo.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/br.js +108 -0
- bp-core/js/vendor/moment-js/locale/br.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/bs.js +143 -0
- bp-core/js/vendor/moment-js/locale/bs.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ca.js +81 -0
- bp-core/js/vendor/moment-js/locale/ca.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/cs.js +172 -0
- bp-core/js/vendor/moment-js/locale/cs.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/cv.js +63 -0
- bp-core/js/vendor/moment-js/locale/cv.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/cy.js +81 -0
- bp-core/js/vendor/moment-js/locale/cy.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/da.js +60 -0
- bp-core/js/vendor/moment-js/locale/da.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/de-at.js +79 -0
- bp-core/js/vendor/moment-js/locale/de-at.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/de.js +78 -0
- bp-core/js/vendor/moment-js/locale/de.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/dv.js +99 -0
- bp-core/js/vendor/moment-js/locale/dv.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/el.js +98 -0
- bp-core/js/vendor/moment-js/locale/el.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/en-au.js +67 -0
- bp-core/js/vendor/moment-js/locale/en-au.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/en-ca.js +63 -0
- bp-core/js/vendor/moment-js/locale/en-ca.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/en-gb.js +67 -0
- bp-core/js/vendor/moment-js/locale/en-gb.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/en-ie.js +67 -0
- bp-core/js/vendor/moment-js/locale/en-ie.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/en-nz.js +67 -0
- bp-core/js/vendor/moment-js/locale/en-nz.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/eo.js +73 -0
- bp-core/js/vendor/moment-js/locale/eo.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/es-do.js +80 -0
- bp-core/js/vendor/moment-js/locale/es-do.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/es.js +81 -0
- bp-core/js/vendor/moment-js/locale/es.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/et.js +80 -0
- bp-core/js/vendor/moment-js/locale/et.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/eu.js +66 -0
- bp-core/js/vendor/moment-js/locale/eu.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/fa.js +106 -0
- bp-core/js/vendor/moment-js/locale/fa.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/fi.js +107 -0
- bp-core/js/vendor/moment-js/locale/fi.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/fo.js +60 -0
- bp-core/js/vendor/moment-js/locale/fo.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/fr-ca.js +60 -0
- bp-core/js/vendor/moment-js/locale/fr-ca.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/fr-ch.js +64 -0
- bp-core/js/vendor/moment-js/locale/fr-ch.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/fr.js +64 -0
- bp-core/js/vendor/moment-js/locale/fr.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/fy.js +73 -0
- bp-core/js/vendor/moment-js/locale/fy.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/gd.js +76 -0
- bp-core/js/vendor/moment-js/locale/gd.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/gl.js +77 -0
- bp-core/js/vendor/moment-js/locale/gl.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/he.js +99 -0
- bp-core/js/vendor/moment-js/locale/he.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/hi.js +124 -0
- bp-core/js/vendor/moment-js/locale/hi.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/hr.js +145 -0
- bp-core/js/vendor/moment-js/locale/hr.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/hu.js +109 -0
- bp-core/js/vendor/moment-js/locale/hu.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/hy-am.js +95 -0
- bp-core/js/vendor/moment-js/locale/hy-am.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/id.js +83 -0
- bp-core/js/vendor/moment-js/locale/id.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/is.js +127 -0
- bp-core/js/vendor/moment-js/locale/is.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/it.js +70 -0
- bp-core/js/vendor/moment-js/locale/it.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ja.js +76 -0
- bp-core/js/vendor/moment-js/locale/ja.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/jv.js +83 -0
- bp-core/js/vendor/moment-js/locale/jv.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ka.js +89 -0
- bp-core/js/vendor/moment-js/locale/ka.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/kk.js +87 -0
- bp-core/js/vendor/moment-js/locale/kk.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/km.js +58 -0
- bp-core/js/vendor/moment-js/locale/km.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ko.js +65 -0
- bp-core/js/vendor/moment-js/locale/ko.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ky.js +88 -0
- bp-core/js/vendor/moment-js/locale/ky.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/lb.js +137 -0
- bp-core/js/vendor/moment-js/locale/lb.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/lo.js +70 -0
- bp-core/js/vendor/moment-js/locale/lo.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/lt.js +117 -0
- bp-core/js/vendor/moment-js/locale/lt.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/lv.js +97 -0
- bp-core/js/vendor/moment-js/locale/lv.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/me.js +111 -0
- bp-core/js/vendor/moment-js/locale/me.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/mi.js +64 -0
- bp-core/js/vendor/moment-js/locale/mi.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/mk.js +90 -0
- bp-core/js/vendor/moment-js/locale/mk.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ml.js +81 -0
- bp-core/js/vendor/moment-js/locale/ml.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/mr.js +159 -0
- bp-core/js/vendor/moment-js/locale/mr.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ms-my.js +83 -0
- bp-core/js/vendor/moment-js/locale/ms-my.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ms.js +82 -0
- bp-core/js/vendor/moment-js/locale/ms.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/my.js +95 -0
- bp-core/js/vendor/moment-js/locale/my.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/nb.js +63 -0
- bp-core/js/vendor/moment-js/locale/nb.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ne.js +123 -0
- bp-core/js/vendor/moment-js/locale/ne.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/nl.js +86 -0
- bp-core/js/vendor/moment-js/locale/nl.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/nn.js +60 -0
- bp-core/js/vendor/moment-js/locale/nn.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/pa-in.js +124 -0
- bp-core/js/vendor/moment-js/locale/pa-in.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/pl.js +105 -0
- bp-core/js/vendor/moment-js/locale/pl.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/pt-br.js +61 -0
- bp-core/js/vendor/moment-js/locale/pt-br.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/pt.js +65 -0
- bp-core/js/vendor/moment-js/locale/pt.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ro.js +75 -0
- bp-core/js/vendor/moment-js/locale/ro.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ru.js +183 -0
- bp-core/js/vendor/moment-js/locale/ru.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/se.js +61 -0
- bp-core/js/vendor/moment-js/locale/se.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/si.js +71 -0
- bp-core/js/vendor/moment-js/locale/si.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/sk.js +150 -0
- bp-core/js/vendor/moment-js/locale/sk.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/sl.js +162 -0
- bp-core/js/vendor/moment-js/locale/sl.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/sq.js +70 -0
- bp-core/js/vendor/moment-js/locale/sq.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/sr-cyrl.js +110 -0
- bp-core/js/vendor/moment-js/locale/sr-cyrl.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/sr.js +110 -0
- bp-core/js/vendor/moment-js/locale/sr.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ss.js +89 -0
- bp-core/js/vendor/moment-js/locale/ss.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/sv.js +69 -0
- bp-core/js/vendor/moment-js/locale/sv.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/sw.js +59 -0
- bp-core/js/vendor/moment-js/locale/sw.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/ta.js +129 -0
- bp-core/js/vendor/moment-js/locale/ta.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/te.js +89 -0
- bp-core/js/vendor/moment-js/locale/te.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/th.js +67 -0
- bp-core/js/vendor/moment-js/locale/th.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/tl-ph.js +62 -0
- bp-core/js/vendor/moment-js/locale/tl-ph.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/tlh.js +120 -0
- bp-core/js/vendor/moment-js/locale/tlh.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/tr.js +90 -0
- bp-core/js/vendor/moment-js/locale/tr.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/tzl.js +91 -0
- bp-core/js/vendor/moment-js/locale/tzl.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/tzm-latn.js +58 -0
- bp-core/js/vendor/moment-js/locale/tzm-latn.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/tzm.js +58 -0
- bp-core/js/vendor/moment-js/locale/tzm.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/uk.js +146 -0
- bp-core/js/vendor/moment-js/locale/uk.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/uz.js +58 -0
- bp-core/js/vendor/moment-js/locale/uz.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/vi.js +79 -0
- bp-core/js/vendor/moment-js/locale/vi.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/x-pseudo.js +68 -0
- bp-core/js/vendor/moment-js/locale/x-pseudo.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/zh-cn.js +127 -0
- bp-core/js/vendor/moment-js/locale/zh-cn.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/zh-hk.js +105 -0
- bp-core/js/vendor/moment-js/locale/zh-hk.min.js +1 -0
- bp-core/js/vendor/moment-js/locale/zh-tw.js +104 -0
- bp-core/js/vendor/moment-js/locale/zh-tw.min.js +1 -0
- bp-core/js/vendor/moment-js/moment.js +4234 -0
- bp-core/js/vendor/moment-js/moment.min.js +2 -0
- bp-forums/bp-forums-bbpress-sa.php +8 -11
- bp-forums/bp-forums-loader.php +18 -0
- bp-forums/bp-forums-template.php +9 -14
- bp-friends/bp-friends-actions.php +2 -2
- bp-friends/bp-friends-cache.php +41 -0
- bp-friends/bp-friends-filters.php +7 -34
- bp-friends/bp-friends-functions.php +75 -0
- bp-friends/bp-friends-loader.php +1 -1
- bp-friends/bp-friends-notifications.php +15 -96
- bp-friends/bp-friends-template.php +0 -4
- bp-friends/bp-friends-widgets.php +2 -2
- bp-friends/classes/class-bp-core-friends-widget.php +7 -10
- bp-friends/classes/class-bp-friends-component.php +8 -2
- bp-friends/classes/class-bp-friends-friendship.php +296 -49
- bp-groups/admin/css/admin-rtl.css +17 -7
- bp-groups/admin/css/admin-rtl.min.css +1 -1
- bp-groups/admin/css/admin.css +17 -7
- bp-groups/admin/css/admin.min.css +1 -1
- bp-groups/admin/js/admin.min.js +1 -1
- bp-groups/bp-groups-actions.php +33 -2
- bp-groups/bp-groups-activity.php +5 -14
- bp-groups/bp-groups-admin.php +129 -26
- bp-groups/bp-groups-cache.php +73 -3
- bp-groups/bp-groups-filters.php +1 -1
- bp-groups/bp-groups-forums.php +1 -1
- bp-groups/bp-groups-functions.php +168 -72
- bp-groups/bp-groups-loader.php +1 -1
- bp-groups/bp-groups-notifications.php +53 -11
- bp-groups/bp-groups-screens.php +43 -1
- bp-groups/bp-groups-template.php +347 -79
- bp-groups/bp-groups-widgets.php +7 -11
- bp-groups/classes/class-bp-group-extension.php +4 -10
- bp-groups/classes/class-bp-groups-component.php +16 -16
- bp-groups/classes/class-bp-groups-group-members-template.php +5 -3
- bp-groups/classes/class-bp-groups-group.php +370 -178
- bp-groups/classes/class-bp-groups-invite-template.php +4 -2
- bp-groups/classes/class-bp-groups-list-table.php +147 -3
- bp-groups/classes/class-bp-groups-member-suggestions.php +1 -6
- bp-groups/classes/class-bp-groups-member.php +90 -27
- bp-groups/classes/class-bp-groups-template.php +5 -6
- bp-groups/classes/class-bp-groups-theme-compat.php +8 -4
- bp-groups/classes/class-bp-groups-widget.php +1 -1
- bp-loader.php +7 -6
- bp-members/bp-members-cache.php +13 -1
- bp-members/bp-members-functions.php +40 -5
- bp-members/bp-members-screens.php +2 -2
- bp-members/bp-members-template.php +60 -34
- bp-members/classes/class-bp-core-members-widget.php +9 -13
- bp-members/classes/class-bp-core-recently-active-widget.php +1 -3
- bp-members/classes/class-bp-core-whos-online-widget.php +1 -4
- bp-members/classes/class-bp-members-admin.php +277 -0
- bp-members/classes/class-bp-members-component.php +5 -1
- bp-messages/bp-messages-functions.php +106 -8
- bp-messages/bp-messages-loader.php +3 -1
- bp-messages/bp-messages-notifications.php +21 -104
- bp-messages/bp-messages-template.php +0 -1
- bp-messages/classes/class-bp-messages-component.php +3 -1
- bp-messages/classes/class-bp-messages-message.php +12 -6
- bp-messages/classes/class-bp-messages-notice.php +8 -2
- bp-messages/classes/class-bp-messages-thread.php +30 -7
- bp-messages/js/autocomplete/jquery.autocomplete.min.js +1 -1
- bp-messages/js/autocomplete/jquery.dimensions.min.js +1 -1
- bp-notifications/bp-notifications-functions.php +4 -2
- bp-notifications/bp-notifications-loader.php +1 -1
- bp-notifications/classes/class-bp-notifications-notification.php +26 -20
- bp-settings/bp-settings-actions.php +1 -1
- bp-settings/bp-settings-loader.php +1 -1
- bp-templates/bp-legacy/buddypress-functions.php +44 -12
- bp-templates/bp-legacy/buddypress/activity/comment.php +2 -2
- bp-templates/bp-legacy/buddypress/activity/entry.php +2 -2
- bp-templates/bp-legacy/buddypress/activity/index.php +18 -15
- bp-templates/bp-legacy/buddypress/activity/single/home.php +7 -3
- bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/index.php +2 -2
- bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php +2 -2
- bp-templates/bp-legacy/buddypress/blogs/create.php +6 -3
- bp-templates/bp-legacy/buddypress/blogs/index.php +19 -5
- bp-templates/bp-legacy/buddypress/common/search/dir-search-form.php +16 -0
- bp-templates/bp-legacy/buddypress/forums/index.php +18 -7
- bp-templates/bp-legacy/buddypress/groups/create.php +92 -32
- bp-templates/bp-legacy/buddypress/groups/groups-loop.php +6 -2
- bp-templates/bp-legacy/buddypress/groups/index.php +25 -8
- bp-templates/bp-legacy/buddypress/groups/single/activity.php +2 -2
- bp-templates/bp-legacy/buddypress/groups/single/admin.php +19 -456
- bp-templates/bp-legacy/buddypress/groups/single/admin/delete-group.php +41 -0
- bp-templates/bp-legacy/buddypress/groups/single/admin/edit-details.php +53 -0
- bp-templates/bp-legacy/buddypress/groups/single/admin/group-avatar.php +67 -0
- bp-templates/bp-legacy/buddypress/groups/single/admin/group-cover-image.php +33 -0
- bp-templates/bp-legacy/buddypress/groups/single/admin/group-settings.php +124 -0
- bp-templates/bp-legacy/buddypress/groups/single/admin/manage-members.php +332 -0
- bp-templates/bp-legacy/buddypress/groups/single/admin/membership-requests.php +35 -0
- bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php +12 -6
- bp-templates/bp-legacy/buddypress/groups/single/forum.php +1 -1
- bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php +1 -1
- bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php +1 -1
- bp-templates/bp-legacy/buddypress/groups/single/group-header.php +13 -7
- bp-templates/bp-legacy/buddypress/groups/single/home.php +1 -1
- bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php +1 -1
- bp-templates/bp-legacy/buddypress/groups/single/members.php +1 -1
- bp-templates/bp-legacy/buddypress/groups/single/request-membership.php +5 -0
- bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php +2 -2
- bp-templates/bp-legacy/buddypress/groups/single/send-invites.php +3 -1
- bp-templates/bp-legacy/buddypress/members/activate.php +6 -3
- bp-templates/bp-legacy/buddypress/members/index.php +20 -7
- bp-templates/bp-legacy/buddypress/members/members-loop.php +2 -2
- bp-templates/bp-legacy/buddypress/members/register.php +43 -27
- bp-templates/bp-legacy/buddypress/members/single/activity.php +2 -2
- bp-templates/bp-legacy/buddypress/members/single/blogs.php +1 -1
- bp-templates/bp-legacy/buddypress/members/single/cover-image-header.php +7 -4
- bp-templates/bp-legacy/buddypress/members/single/forums.php +1 -1
- bp-templates/bp-legacy/buddypress/members/single/friends.php +13 -1
- bp-templates/bp-legacy/buddypress/members/single/friends/requests.php +5 -0
- bp-templates/bp-legacy/buddypress/members/single/groups.php +13 -1
- bp-templates/bp-legacy/buddypress/members/single/groups/invites.php +5 -0
- bp-templates/bp-legacy/buddypress/members/single/home.php +1 -1
- bp-templates/bp-legacy/buddypress/members/single/member-header.php +7 -4
- bp-templates/bp-legacy/buddypress/members/single/messages.php +18 -1
- bp-templates/bp-legacy/buddypress/members/single/messages/compose.php +5 -0
- bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php +5 -0
- bp-templates/bp-legacy/buddypress/members/single/messages/single.php +1 -1
- bp-templates/bp-legacy/buddypress/members/single/notifications.php +1 -1
- bp-templates/bp-legacy/buddypress/members/single/notifications/read.php +5 -0
- bp-templates/bp-legacy/buddypress/members/single/notifications/unread.php +5 -0
- bp-templates/bp-legacy/buddypress/members/single/plugins.php +1 -1
- bp-templates/bp-legacy/buddypress/members/single/profile.php +1 -1
- bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php +2 -2
- bp-templates/bp-legacy/buddypress/members/single/profile/change-cover-image.php +1 -1
- bp-templates/bp-legacy/buddypress/members/single/profile/edit.php +2 -2
- bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php +1 -1
- bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php +1 -1
- bp-templates/bp-legacy/buddypress/members/single/settings.php +1 -1
- bp-templates/bp-legacy/buddypress/members/single/settings/general.php +5 -0
- bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php +5 -0
- bp-templates/bp-legacy/buddypress/members/single/settings/profile.php +5 -0
- bp-templates/bp-legacy/css/buddypress-rtl.css +35 -9
- bp-templates/bp-legacy/css/buddypress-rtl.min.css +1 -1
- bp-templates/bp-legacy/css/buddypress.css +35 -9
- bp-templates/bp-legacy/css/buddypress.min.css +1 -1
- bp-templates/bp-legacy/css/twentyeleven-rtl.css +5 -5
- bp-templates/bp-legacy/css/twentyeleven-rtl.min.css +1 -1
- bp-templates/bp-legacy/css/twentyeleven.css +5 -5
- bp-templates/bp-legacy/css/twentyeleven.min.css +1 -1
- bp-templates/bp-legacy/css/twentyeleven.scss +5 -5
- bp-templates/bp-legacy/css/twentyfifteen-rtl.css +15 -5
- bp-templates/bp-legacy/css/twentyfifteen-rtl.min.css +1 -1
- bp-templates/bp-legacy/css/twentyfifteen.css +15 -5
- bp-templates/bp-legacy/css/twentyfifteen.min.css +1 -1
- bp-templates/bp-legacy/css/twentyfifteen.scss +18 -5
- bp-templates/bp-legacy/css/twentyfourteen-rtl.css +28 -7
- bp-templates/bp-legacy/css/twentyfourteen-rtl.min.css +1 -1
- bp-templates/bp-legacy/css/twentyfourteen.css +28 -7
- bp-templates/bp-legacy/css/twentyfourteen.min.css +1 -1
- bp-templates/bp-legacy/css/twentyfourteen.scss +32 -8
- bp-templates/bp-legacy/css/twentysixteen-rtl.css +41 -9
- bp-templates/bp-legacy/css/twentysixteen-rtl.min.css +1 -1
- bp-templates/bp-legacy/css/twentysixteen.css +41 -9
- bp-templates/bp-legacy/css/twentysixteen.min.css +1 -1
- bp-templates/bp-legacy/css/twentysixteen.scss +49 -5
- bp-templates/bp-legacy/css/twentyten-rtl.css +5 -5
- bp-templates/bp-legacy/css/twentyten-rtl.min.css +1 -1
- bp-templates/bp-legacy/css/twentyten.css +5 -5
- bp-templates/bp-legacy/css/twentyten.min.css +1 -1
- bp-templates/bp-legacy/css/twentyten.scss +5 -5
- bp-templates/bp-legacy/css/twentythirteen-rtl.css +21 -12
- bp-templates/bp-legacy/css/twentythirteen-rtl.min.css +1 -1
- bp-templates/bp-legacy/css/twentythirteen.css +21 -12
- bp-templates/bp-legacy/css/twentythirteen.min.css +1 -1
- bp-templates/bp-legacy/css/twentythirteen.scss +21 -12
- bp-templates/bp-legacy/css/twentytwelve-rtl.css +10 -6
- bp-templates/bp-legacy/css/twentytwelve-rtl.min.css +1 -1
- bp-templates/bp-legacy/css/twentytwelve.css +10 -6
- bp-templates/bp-legacy/css/twentytwelve.min.css +1 -1
- bp-templates/bp-legacy/css/twentytwelve.scss +10 -7
- bp-templates/bp-legacy/js/buddypress.js +13 -2
- bp-templates/bp-legacy/js/buddypress.min.js +1 -1
- bp-templates/bp-legacy/js/password-verify.min.js +1 -1
- bp-themes/bp-default/_inc/ajax.php +11 -4
- bp-xprofile/admin/css/admin-rtl.css +76 -0
- bp-xprofile/admin/css/admin-rtl.min.css +1 -1
- bp-xprofile/admin/css/admin.css +76 -0
- bp-xprofile/admin/css/admin.min.css +1 -1
- bp-xprofile/admin/js/admin.js +44 -3
- bp-xprofile/admin/js/admin.min.js +1 -1
- bp-xprofile/bp-xprofile-activity.php +1 -1
- bp-xprofile/bp-xprofile-admin.php +8 -3
- bp-xprofile/bp-xprofile-caps.php +22 -3
- bp-xprofile/bp-xprofile-cssjs.php +3 -3
- bp-xprofile/bp-xprofile-functions.php +1 -1
- bp-xprofile/bp-xprofile-loader.php +1 -1
- bp-xprofile/bp-xprofile-template.php +2 -3
- bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php +298 -6
- bp-xprofile/classes/class-bp-xprofile-field-type-placeholder.php +2 -0
- bp-xprofile/classes/class-bp-xprofile-field-type-url.php +4 -4
- bp-xprofile/classes/class-bp-xprofile-field-type.php +38 -1
- bp-xprofile/classes/class-bp-xprofile-field.php +45 -25
- bp-xprofile/classes/class-bp-xprofile-group.php +12 -2
- bp-xprofile/classes/class-bp-xprofile-profiledata.php +30 -6
- bp-xprofile/classes/class-bp-xprofile-query.php +1 -1
- bp-xprofile/classes/class-bp-xprofile-user-admin.php +2 -2
- buddypress.pot +1930 -1511
- composer.json +6 -5
- humans.txt +14 -1
- readme.txt +33 -11
bp-activity/bp-activity-actions.php
CHANGED
@@ -71,7 +71,7 @@ function bp_activity_action_permalink_router() {
|
|
71 |
} else {
|
72 |
|
73 |
// Set redirect to group activity stream.
|
74 |
-
if ( $group = groups_get_group(
|
75 |
$redirect = bp_get_group_permalink( $group ) . bp_get_activity_slug() . '/' . $activity->id . '/';
|
76 |
}
|
77 |
}
|
@@ -604,45 +604,6 @@ function bp_activity_action_favorites_feed() {
|
|
604 |
}
|
605 |
add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
|
606 |
|
607 |
-
/**
|
608 |
-
* Loads Akismet filtering for activity.
|
609 |
-
*
|
610 |
-
* @since 1.6.0
|
611 |
-
* @since 2.3.0 We only support Akismet 3+.
|
612 |
-
*/
|
613 |
-
function bp_activity_setup_akismet() {
|
614 |
-
$bp = buddypress();
|
615 |
-
|
616 |
-
// Bail if Akismet is not active.
|
617 |
-
if ( ! defined( 'AKISMET_VERSION' ) ) {
|
618 |
-
return;
|
619 |
-
}
|
620 |
-
|
621 |
-
// Bail if older version of Akismet.
|
622 |
-
if ( ! class_exists( 'Akismet' ) ) {
|
623 |
-
return;
|
624 |
-
}
|
625 |
-
|
626 |
-
// Bail if no Akismet key is set.
|
627 |
-
if ( ! bp_get_option( 'wordpress_api_key' ) && ! defined( 'WPCOM_API_KEY' ) ) {
|
628 |
-
return;
|
629 |
-
}
|
630 |
-
|
631 |
-
/**
|
632 |
-
* Filters if BuddyPress Activity Akismet support has been disabled by another plugin.
|
633 |
-
*
|
634 |
-
* @since 1.6.0
|
635 |
-
*
|
636 |
-
* @param bool $value Return value of bp_is_akismet_active boolean function.
|
637 |
-
*/
|
638 |
-
if ( ! apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) {
|
639 |
-
return;
|
640 |
-
}
|
641 |
-
|
642 |
-
// Instantiate Akismet for BuddyPress.
|
643 |
-
$bp->activity->akismet = new BP_Akismet();
|
644 |
-
}
|
645 |
-
|
646 |
/**
|
647 |
* AJAX endpoint for Suggestions API lookups.
|
648 |
*
|
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 |
}
|
604 |
}
|
605 |
add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
|
606 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
607 |
/**
|
608 |
* AJAX endpoint for Suggestions API lookups.
|
609 |
*
|
bp-activity/bp-activity-akismet.php
CHANGED
@@ -14,6 +14,29 @@ if ( ! buddypress()->do_autoload ) {
|
|
14 |
require dirname( __FILE__ ) . '/classes/class-bp-akismet.php';
|
15 |
}
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
/**
|
18 |
* Delete old spam activity meta data.
|
19 |
*
|
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.
|
42 |
*
|
bp-activity/bp-activity-cache.php
CHANGED
@@ -63,3 +63,24 @@ 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' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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' );
|
bp-activity/bp-activity-filters.php
CHANGED
@@ -207,13 +207,15 @@ function bp_activity_filter_kses( $content ) {
|
|
207 |
global $allowedtags;
|
208 |
|
209 |
$activity_allowedtags = $allowedtags;
|
210 |
-
$activity_allowedtags['a']['class']
|
211 |
-
$activity_allowedtags['a']['id']
|
212 |
-
$activity_allowedtags['a']['rel']
|
213 |
-
$activity_allowedtags['a']['title']
|
214 |
-
|
215 |
-
$activity_allowedtags['
|
216 |
-
$activity_allowedtags['
|
|
|
|
|
217 |
$activity_allowedtags['img'] = array();
|
218 |
$activity_allowedtags['img']['src'] = array();
|
219 |
$activity_allowedtags['img']['alt'] = array();
|
@@ -222,8 +224,10 @@ function bp_activity_filter_kses( $content ) {
|
|
222 |
$activity_allowedtags['img']['class'] = array();
|
223 |
$activity_allowedtags['img']['id'] = array();
|
224 |
$activity_allowedtags['img']['title'] = array();
|
225 |
-
|
226 |
-
$activity_allowedtags['span
|
|
|
|
|
227 |
|
228 |
|
229 |
/**
|
@@ -278,7 +282,7 @@ function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
|
|
278 |
|
279 |
// Linkify the mentions with the username.
|
280 |
foreach ( (array) $usernames as $user_id => $username ) {
|
281 |
-
$content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $content );
|
282 |
}
|
283 |
|
284 |
// Put everything back.
|
@@ -319,7 +323,7 @@ function bp_activity_at_name_filter_updates( $activity ) {
|
|
319 |
if ( ! empty( $usernames ) ) {
|
320 |
// Replace @mention text with userlinks.
|
321 |
foreach( (array) $usernames as $user_id => $username ) {
|
322 |
-
$activity->content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $activity->content );
|
323 |
}
|
324 |
|
325 |
// Add our hook to send @mention emails after the activity item is saved.
|
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 |
$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 |
|
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.
|
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.
|
bp-activity/bp-activity-functions.php
CHANGED
@@ -1663,56 +1663,28 @@ function bp_activity_get( $args = '' ) {
|
|
1663 |
* );
|
1664 |
*/
|
1665 |
'filter' => array()
|
1666 |
-
|
1667 |
-
|
1668 |
-
// Attempt to return a cached copy of the first page of sitewide activity.
|
1669 |
-
if ( ( 1 === (int) $r['page'] ) && empty( $r['max'] ) && ( 'all' === $r['fields'] ) && empty( $r['search_terms'] ) && empty( $r['meta_query'] ) && empty( $r['date_query'] ) && empty( $r['filter_query'] ) && empty( $r['filter'] ) && empty( $r['scope'] )&& empty( $r['exclude'] ) && empty( $r['in'] ) && ( 'DESC' === $r['sort'] ) && empty( $r['exclude'] ) && ( 'ham_only' === $r['spam'] ) ) {
|
1670 |
-
|
1671 |
-
$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' );
|
1672 |
-
if ( false === $activity ) {
|
1673 |
-
|
1674 |
-
$activity = BP_Activity_Activity::get( array(
|
1675 |
-
'page' => $r['page'],
|
1676 |
-
'per_page' => $r['per_page'],
|
1677 |
-
'max' => $r['max'],
|
1678 |
-
'fields' => $r['fields'],
|
1679 |
-
'sort' => $r['sort'],
|
1680 |
-
'search_terms' => $r['search_terms'],
|
1681 |
-
'meta_query' => $r['meta_query'],
|
1682 |
-
'date_query' => $r['date_query'],
|
1683 |
-
'filter_query' => $r['filter_query'],
|
1684 |
-
'filter' => $r['filter'],
|
1685 |
-
'scope' => $r['scope'],
|
1686 |
-
'display_comments' => $r['display_comments'],
|
1687 |
-
'show_hidden' => $r['show_hidden'],
|
1688 |
-
'spam' => $r['spam'],
|
1689 |
-
'update_meta_cache' => $r['update_meta_cache'],
|
1690 |
-
'count_total' => $r['count_total'],
|
1691 |
-
) );
|
1692 |
-
|
1693 |
-
wp_cache_set( 'bp_activity_sitewide_front', $activity, 'bp' );
|
1694 |
-
}
|
1695 |
|
1696 |
-
|
1697 |
-
$
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
|
1717 |
/**
|
1718 |
* Filters the requested activity item(s).
|
@@ -1898,10 +1870,13 @@ function bp_activity_add( $args = '' ) {
|
|
1898 |
* @since 1.2.0
|
1899 |
*
|
1900 |
* @param array|string $args {
|
1901 |
-
* @type string $content
|
1902 |
-
* @type int $user_id
|
|
|
|
|
1903 |
* }
|
1904 |
-
* @return int $activity_id The activity id.
|
|
|
1905 |
*/
|
1906 |
function bp_activity_post_update( $args = '' ) {
|
1907 |
|
@@ -3417,6 +3392,211 @@ function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
|
|
3417 |
do_action( 'bp_activity_mark_as_ham', $activity, $source );
|
3418 |
}
|
3419 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3420 |
|
3421 |
/** Embeds *******************************************************************/
|
3422 |
|
1663 |
* );
|
1664 |
*/
|
1665 |
'filter' => array()
|
1666 |
+
), 'activity_get' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1667 |
|
1668 |
+
$activity = BP_Activity_Activity::get( array(
|
1669 |
+
'page' => $r['page'],
|
1670 |
+
'per_page' => $r['per_page'],
|
1671 |
+
'max' => $r['max'],
|
1672 |
+
'sort' => $r['sort'],
|
1673 |
+
'search_terms' => $r['search_terms'],
|
1674 |
+
'meta_query' => $r['meta_query'],
|
1675 |
+
'date_query' => $r['date_query'],
|
1676 |
+
'filter_query' => $r['filter_query'],
|
1677 |
+
'filter' => $r['filter'],
|
1678 |
+
'scope' => $r['scope'],
|
1679 |
+
'display_comments' => $r['display_comments'],
|
1680 |
+
'show_hidden' => $r['show_hidden'],
|
1681 |
+
'exclude' => $r['exclude'],
|
1682 |
+
'in' => $r['in'],
|
1683 |
+
'spam' => $r['spam'],
|
1684 |
+
'update_meta_cache' => $r['update_meta_cache'],
|
1685 |
+
'count_total' => $r['count_total'],
|
1686 |
+
'fields' => $r['fields'],
|
1687 |
+
) );
|
1688 |
|
1689 |
/**
|
1690 |
* Filters the requested activity item(s).
|
1870 |
* @since 1.2.0
|
1871 |
*
|
1872 |
* @param array|string $args {
|
1873 |
+
* @type string $content The content of the activity update.
|
1874 |
+
* @type int $user_id Optional. Defaults to the logged-in user.
|
1875 |
+
* @type string $error_type Optional. Error type to return. Either 'bool' or 'wp_error'. Defaults to
|
1876 |
+
* 'bool' for boolean. 'wp_error' will return a WP_Error object.
|
1877 |
* }
|
1878 |
+
* @return int|bool|WP_Error $activity_id The activity id on success. On failure, either boolean false or WP_Error
|
1879 |
+
* object depending on the 'error_type' $args parameter.
|
1880 |
*/
|
1881 |
function bp_activity_post_update( $args = '' ) {
|
1882 |
|
3392 |
do_action( 'bp_activity_mark_as_ham', $activity, $source );
|
3393 |
}
|
3394 |
|
3395 |
+
/* Emails *********************************************************************/
|
3396 |
+
|
3397 |
+
/**
|
3398 |
+
* Send email and BP notifications when a user is mentioned in an update.
|
3399 |
+
*
|
3400 |
+
* @since 1.2.0
|
3401 |
+
*
|
3402 |
+
* @param int $activity_id The ID of the activity update.
|
3403 |
+
* @param int $receiver_user_id The ID of the user who is receiving the update.
|
3404 |
+
*/
|
3405 |
+
function bp_activity_at_message_notification( $activity_id, $receiver_user_id ) {
|
3406 |
+
$notifications = BP_Core_Notification::get_all_for_user( $receiver_user_id, 'all' );
|
3407 |
+
|
3408 |
+
// Don't leave multiple notifications for the same activity item.
|
3409 |
+
foreach( $notifications as $notification ) {
|
3410 |
+
if ( $activity_id == $notification->item_id ) {
|
3411 |
+
return;
|
3412 |
+
}
|
3413 |
+
}
|
3414 |
+
|
3415 |
+
$activity = new BP_Activity_Activity( $activity_id );
|
3416 |
+
$email_type = 'activity-at-message';
|
3417 |
+
$group_name = '';
|
3418 |
+
$message_link = bp_activity_get_permalink( $activity_id );
|
3419 |
+
$poster_name = bp_core_get_user_displayname( $activity->user_id );
|
3420 |
+
|
3421 |
+
remove_filter( 'bp_get_activity_content_body', 'convert_smilies' );
|
3422 |
+
remove_filter( 'bp_get_activity_content_body', 'wpautop' );
|
3423 |
+
remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
|
3424 |
+
|
3425 |
+
/** This filter is documented in bp-activity/bp-activity-template.php */
|
3426 |
+
$content = apply_filters( 'bp_get_activity_content_body', $activity->content );
|
3427 |
+
|
3428 |
+
add_filter( 'bp_get_activity_content_body', 'convert_smilies' );
|
3429 |
+
add_filter( 'bp_get_activity_content_body', 'wpautop' );
|
3430 |
+
add_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
|
3431 |
+
|
3432 |
+
// Now email the user with the contents of the message (if they have enabled email notifications).
|
3433 |
+
if ( 'no' != bp_get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) {
|
3434 |
+
if ( bp_is_active( 'groups' ) && bp_is_group() ) {
|
3435 |
+
$email_type = 'groups-at-message';
|
3436 |
+
$group_name = bp_get_current_group_name();
|
3437 |
+
}
|
3438 |
+
|
3439 |
+
$unsubscribe_args = array(
|
3440 |
+
'user_id' => $receiver_user_id,
|
3441 |
+
'notification_type' => $email_type,
|
3442 |
+
);
|
3443 |
+
|
3444 |
+
$args = array(
|
3445 |
+
'tokens' => array(
|
3446 |
+
'activity' => $activity,
|
3447 |
+
'usermessage' => wp_strip_all_tags( $content ),
|
3448 |
+
'group.name' => $group_name,
|
3449 |
+
'mentioned.url' => $message_link,
|
3450 |
+
'poster.name' => $poster_name,
|
3451 |
+
'receiver-user.id' => $receiver_user_id,
|
3452 |
+
'unsubscribe' => esc_url( bp_email_get_unsubscribe_link( $unsubscribe_args ) ),
|
3453 |
+
),
|
3454 |
+
);
|
3455 |
+
|
3456 |
+
bp_send_email( $email_type, $receiver_user_id, $args );
|
3457 |
+
}
|
3458 |
+
|
3459 |
+
/**
|
3460 |
+
* Fires after the sending of an @mention email notification.
|
3461 |
+
*
|
3462 |
+
* @since 1.5.0
|
3463 |
+
* @since 2.5.0 $subject, $message, $content arguments unset and deprecated.
|
3464 |
+
*
|
3465 |
+
* @param BP_Activity_Activity $activity Activity Item object.
|
3466 |
+
* @param string $deprecated Removed in 2.5; now an empty string.
|
3467 |
+
* @param string $deprecated Removed in 2.5; now an empty string.
|
3468 |
+
* @param string $deprecated Removed in 2.5; now an empty string.
|
3469 |
+
* @param int $receiver_user_id The ID of the user who is receiving the update.
|
3470 |
+
*/
|
3471 |
+
do_action( 'bp_activity_sent_mention_email', $activity, '', '', '', $receiver_user_id );
|
3472 |
+
}
|
3473 |
+
|
3474 |
+
/**
|
3475 |
+
* Send email and BP notifications when an activity item receives a comment.
|
3476 |
+
*
|
3477 |
+
* @since 1.2.0
|
3478 |
+
* @since 2.5.0 Updated to use new email APIs.
|
3479 |
+
*
|
3480 |
+
* @param int $comment_id The comment id.
|
3481 |
+
* @param int $commenter_id The ID of the user who posted the comment.
|
3482 |
+
* @param array $params {@link bp_activity_new_comment()}.
|
3483 |
+
*/
|
3484 |
+
function bp_activity_new_comment_notification( $comment_id = 0, $commenter_id = 0, $params = array() ) {
|
3485 |
+
$original_activity = new BP_Activity_Activity( $params['activity_id'] );
|
3486 |
+
$poster_name = bp_core_get_user_displayname( $commenter_id );
|
3487 |
+
$thread_link = bp_activity_get_permalink( $params['activity_id'] );
|
3488 |
+
|
3489 |
+
remove_filter( 'bp_get_activity_content_body', 'convert_smilies' );
|
3490 |
+
remove_filter( 'bp_get_activity_content_body', 'wpautop' );
|
3491 |
+
remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
|
3492 |
+
|
3493 |
+
/** This filter is documented in bp-activity/bp-activity-template.php */
|
3494 |
+
$content = apply_filters( 'bp_get_activity_content_body', $params['content'] );
|
3495 |
+
|
3496 |
+
add_filter( 'bp_get_activity_content_body', 'convert_smilies' );
|
3497 |
+
add_filter( 'bp_get_activity_content_body', 'wpautop' );
|
3498 |
+
add_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
|
3499 |
+
|
3500 |
+
if ( $original_activity->user_id != $commenter_id ) {
|
3501 |
+
|
3502 |
+
// Send an email if the user hasn't opted-out.
|
3503 |
+
if ( 'no' != bp_get_user_meta( $original_activity->user_id, 'notification_activity_new_reply', true ) ) {
|
3504 |
+
|
3505 |
+
$unsubscribe_args = array(
|
3506 |
+
'user_id' => $original_activity->user_id,
|
3507 |
+
'notification_type' => 'activity-comment',
|
3508 |
+
);
|
3509 |
+
|
3510 |
+
$args = array(
|
3511 |
+
'tokens' => array(
|
3512 |
+
'comment.id' => $comment_id,
|
3513 |
+
'commenter.id' => $commenter_id,
|
3514 |
+
'usermessage' => wp_strip_all_tags( $content ),
|
3515 |
+
'original_activity.user_id' => $original_activity->user_id,
|
3516 |
+
'poster.name' => $poster_name,
|
3517 |
+
'thread.url' => esc_url( $thread_link ),
|
3518 |
+
'unsubscribe' => esc_url( bp_email_get_unsubscribe_link( $unsubscribe_args ) ),
|
3519 |
+
),
|
3520 |
+
);
|
3521 |
+
|
3522 |
+
bp_send_email( 'activity-comment', $original_activity->user_id, $args );
|
3523 |
+
}
|
3524 |
+
|
3525 |
+
/**
|
3526 |
+
* Fires at the point that notifications should be sent for activity comments.
|
3527 |
+
*
|
3528 |
+
* @since 2.6.0
|
3529 |
+
*
|
3530 |
+
* @param BP_Activity_Activity $original_activity The original activity.
|
3531 |
+
* @param int $comment_id ID for the newly received comment.
|
3532 |
+
* @param int $commenter_id ID of the user who made the comment.
|
3533 |
+
* @param array $params Arguments used with the original activity comment.
|
3534 |
+
*/
|
3535 |
+
do_action( 'bp_activity_sent_reply_to_update_notification', $original_activity, $comment_id, $commenter_id, $params );
|
3536 |
+
}
|
3537 |
+
|
3538 |
+
|
3539 |
+
/*
|
3540 |
+
* If this is a reply to another comment, send an email notification to the
|
3541 |
+
* author of the immediate parent comment.
|
3542 |
+
*/
|
3543 |
+
if ( empty( $params['parent_id'] ) || ( $params['activity_id'] == $params['parent_id'] ) ) {
|
3544 |
+
return;
|
3545 |
+
}
|
3546 |
+
|
3547 |
+
$parent_comment = new BP_Activity_Activity( $params['parent_id'] );
|
3548 |
+
|
3549 |
+
if ( $parent_comment->user_id != $commenter_id && $original_activity->user_id != $parent_comment->user_id ) {
|
3550 |
+
|
3551 |
+
// Send an email if the user hasn't opted-out.
|
3552 |
+
if ( 'no' != bp_get_user_meta( $parent_comment->user_id, 'notification_activity_new_reply', true ) ) {
|
3553 |
+
|
3554 |
+
$unsubscribe_args = array(
|
3555 |
+
'user_id' => $parent_comment->user_id,
|
3556 |
+
'notification_type' => 'activity-comment-author',
|
3557 |
+
);
|
3558 |
+
|
3559 |
+
$args = array(
|
3560 |
+
'tokens' => array(
|
3561 |
+
'comment.id' => $comment_id,
|
3562 |
+
'commenter.id' => $commenter_id,
|
3563 |
+
'usermessage' => wp_strip_all_tags( $content ),
|
3564 |
+
'parent-comment-user.id' => $parent_comment->user_id,
|
3565 |
+
'poster.name' => $poster_name,
|
3566 |
+
'thread.url' => esc_url( $thread_link ),
|
3567 |
+
'unsubscribe' => esc_url( bp_email_get_unsubscribe_link( $unsubscribe_args ) ),
|
3568 |
+
),
|
3569 |
+
);
|
3570 |
+
|
3571 |
+
bp_send_email( 'activity-comment-author', $parent_comment->user_id, $args );
|
3572 |
+
}
|
3573 |
+
|
3574 |
+
/**
|
3575 |
+
* Fires at the point that notifications should be sent for comments on activity replies.
|
3576 |
+
*
|
3577 |
+
* @since 2.6.0
|
3578 |
+
*
|
3579 |
+
* @param BP_Activity_Activity $parent_comment The parent activity.
|
3580 |
+
* @param int $comment_id ID for the newly received comment.
|
3581 |
+
* @param int $commenter_id ID of the user who made the comment.
|
3582 |
+
* @param array $params Arguments used with the original activity comment.
|
3583 |
+
*/
|
3584 |
+
do_action( 'bp_activity_sent_reply_to_reply_notification', $parent_comment, $comment_id, $commenter_id, $params );
|
3585 |
+
}
|
3586 |
+
}
|
3587 |
+
|
3588 |
+
/**
|
3589 |
+
* Helper method to map action arguments to function parameters.
|
3590 |
+
*
|
3591 |
+
* @since 1.9.0
|
3592 |
+
*
|
3593 |
+
* @param int $comment_id ID of the comment being notified about.
|
3594 |
+
* @param array $params Parameters to use with notification.
|
3595 |
+
*/
|
3596 |
+
function bp_activity_new_comment_notification_helper( $comment_id, $params ) {
|
3597 |
+
bp_activity_new_comment_notification( $comment_id, $params['user_id'], $params );
|
3598 |
+
}
|
3599 |
+
add_action( 'bp_activity_comment_posted', 'bp_activity_new_comment_notification_helper', 10, 2 );
|
3600 |
|
3601 |
/** Embeds *******************************************************************/
|
3602 |
|
bp-activity/bp-activity-loader.php
CHANGED
@@ -17,7 +17,7 @@ if ( ! buddypress()->do_autoload ) {
|
|
17 |
}
|
18 |
|
19 |
/**
|
20 |
-
*
|
21 |
*
|
22 |
* @since 1.6.0
|
23 |
*/
|
17 |
}
|
18 |
|
19 |
/**
|
20 |
+
* Set up the bp-activity component.
|
21 |
*
|
22 |
* @since 1.6.0
|
23 |
*/
|
bp-activity/bp-activity-notifications.php
CHANGED
@@ -10,194 +10,6 @@
|
|
10 |
// Exit if accessed directly.
|
11 |
defined( 'ABSPATH' ) || exit;
|
12 |
|
13 |
-
/* Emails *********************************************************************/
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Send email and BP notifications when a user is mentioned in an update.
|
17 |
-
*
|
18 |
-
* @since 1.2.0
|
19 |
-
*
|
20 |
-
* @param int $activity_id The ID of the activity update.
|
21 |
-
* @param int $receiver_user_id The ID of the user who is receiving the update.
|
22 |
-
*/
|
23 |
-
function bp_activity_at_message_notification( $activity_id, $receiver_user_id ) {
|
24 |
-
$notifications = BP_Core_Notification::get_all_for_user( $receiver_user_id, 'all' );
|
25 |
-
|
26 |
-
// Don't leave multiple notifications for the same activity item.
|
27 |
-
foreach( $notifications as $notification ) {
|
28 |
-
if ( $activity_id == $notification->item_id ) {
|
29 |
-
return;
|
30 |
-
}
|
31 |
-
}
|
32 |
-
|
33 |
-
$activity = new BP_Activity_Activity( $activity_id );
|
34 |
-
$email_type = 'activity-at-message';
|
35 |
-
$group_name = '';
|
36 |
-
$message_link = bp_activity_get_permalink( $activity_id );
|
37 |
-
$poster_name = bp_core_get_user_displayname( $activity->user_id );
|
38 |
-
|
39 |
-
remove_filter( 'bp_get_activity_content_body', 'convert_smilies' );
|
40 |
-
remove_filter( 'bp_get_activity_content_body', 'wpautop' );
|
41 |
-
remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
|
42 |
-
|
43 |
-
/** This filter is documented in bp-activity/bp-activity-template.php */
|
44 |
-
$content = apply_filters( 'bp_get_activity_content_body', $activity->content );
|
45 |
-
|
46 |
-
add_filter( 'bp_get_activity_content_body', 'convert_smilies' );
|
47 |
-
add_filter( 'bp_get_activity_content_body', 'wpautop' );
|
48 |
-
add_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
|
49 |
-
|
50 |
-
// Now email the user with the contents of the message (if they have enabled email notifications).
|
51 |
-
if ( 'no' != bp_get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) {
|
52 |
-
if ( bp_is_active( 'groups' ) && bp_is_group() ) {
|
53 |
-
$email_type = 'groups-at-message';
|
54 |
-
$group_name = bp_get_current_group_name();
|
55 |
-
}
|
56 |
-
|
57 |
-
$args = array(
|
58 |
-
'tokens' => array(
|
59 |
-
'activity' => $activity,
|
60 |
-
'usermessage' => wp_strip_all_tags( $content ),
|
61 |
-
'group.name' => $group_name,
|
62 |
-
'mentioned.url' => $message_link,
|
63 |
-
'poster.name' => $poster_name,
|
64 |
-
'receiver-user.id' => $receiver_user_id,
|
65 |
-
),
|
66 |
-
);
|
67 |
-
|
68 |
-
bp_send_email( $email_type, $receiver_user_id, $args );
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Fires after the sending of an @mention email notification.
|
73 |
-
*
|
74 |
-
* @since 1.5.0
|
75 |
-
* @since 2.5.0 $subject, $message, $content arguments unset and deprecated.
|
76 |
-
*
|
77 |
-
* @param BP_Activity_Activity $activity Activity Item object.
|
78 |
-
* @param string $deprecated Removed in 2.5; now an empty string.
|
79 |
-
* @param string $deprecated Removed in 2.5; now an empty string.
|
80 |
-
* @param string $deprecated Removed in 2.5; now an empty string.
|
81 |
-
* @param int $receiver_user_id The ID of the user who is receiving the update.
|
82 |
-
*/
|
83 |
-
do_action( 'bp_activity_sent_mention_email', $activity, '', '', '', $receiver_user_id );
|
84 |
-
}
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Send email and BP notifications when an activity item receives a comment.
|
88 |
-
*
|
89 |
-
* @since 1.2.0
|
90 |
-
* @since 2.5.0 Updated to use new email APIs.
|
91 |
-
*
|
92 |
-
* @param int $comment_id The comment id.
|
93 |
-
* @param int $commenter_id The ID of the user who posted the comment.
|
94 |
-
* @param array $params {@link bp_activity_new_comment()}.
|
95 |
-
*/
|
96 |
-
function bp_activity_new_comment_notification( $comment_id = 0, $commenter_id = 0, $params = array() ) {
|
97 |
-
$original_activity = new BP_Activity_Activity( $params['activity_id'] );
|
98 |
-
$poster_name = bp_core_get_user_displayname( $commenter_id );
|
99 |
-
$thread_link = bp_activity_get_permalink( $params['activity_id'] );
|
100 |
-
|
101 |
-
remove_filter( 'bp_get_activity_content_body', 'convert_smilies' );
|
102 |
-
remove_filter( 'bp_get_activity_content_body', 'wpautop' );
|
103 |
-
remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
|
104 |
-
|
105 |
-
/** This filter is documented in bp-activity/bp-activity-template.php */
|
106 |
-
$content = apply_filters( 'bp_get_activity_content_body', $params['content'] );
|
107 |
-
|
108 |
-
add_filter( 'bp_get_activity_content_body', 'convert_smilies' );
|
109 |
-
add_filter( 'bp_get_activity_content_body', 'wpautop' );
|
110 |
-
add_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
|
111 |
-
|
112 |
-
if ( $original_activity->user_id != $commenter_id ) {
|
113 |
-
|
114 |
-
// Send an email if the user hasn't opted-out.
|
115 |
-
if ( 'no' != bp_get_user_meta( $original_activity->user_id, 'notification_activity_new_reply', true ) ) {
|
116 |
-
$args = array(
|
117 |
-
'tokens' => array(
|
118 |
-
'comment.id' => $comment_id,
|
119 |
-
'commenter.id' => $commenter_id,
|
120 |
-
'usermessage' => wp_strip_all_tags( $content ),
|
121 |
-
'original_activity.user_id' => $original_activity->user_id,
|
122 |
-
'poster.name' => $poster_name,
|
123 |
-
'thread.url' => esc_url( $thread_link ),
|
124 |
-
),
|
125 |
-
);
|
126 |
-
|
127 |
-
bp_send_email( 'activity-comment', $original_activity->user_id, $args );
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* Fires at the point that notifications should be sent for activity comments.
|
132 |
-
*
|
133 |
-
* @since 2.6.0
|
134 |
-
*
|
135 |
-
* @param BP_Activity_Activity $original_activity The original activity.
|
136 |
-
* @param int $comment_id ID for the newly received comment.
|
137 |
-
* @param int $commenter_id ID of the user who made the comment.
|
138 |
-
* @param array $params Arguments used with the original activity comment.
|
139 |
-
*/
|
140 |
-
do_action( 'bp_activity_sent_reply_to_update_notification', $original_activity, $comment_id, $commenter_id, $params );
|
141 |
-
}
|
142 |
-
|
143 |
-
|
144 |
-
/*
|
145 |
-
* If this is a reply to another comment, send an email notification to the
|
146 |
-
* author of the immediate parent comment.
|
147 |
-
*/
|
148 |
-
if ( empty( $params['parent_id'] ) || ( $params['activity_id'] == $params['parent_id'] ) ) {
|
149 |
-
return;
|
150 |
-
}
|
151 |
-
|
152 |
-
$parent_comment = new BP_Activity_Activity( $params['parent_id'] );
|
153 |
-
|
154 |
-
if ( $parent_comment->user_id != $commenter_id && $original_activity->user_id != $parent_comment->user_id ) {
|
155 |
-
|
156 |
-
// Send an email if the user hasn't opted-out.
|
157 |
-
if ( 'no' != bp_get_user_meta( $parent_comment->user_id, 'notification_activity_new_reply', true ) ) {
|
158 |
-
$args = array(
|
159 |
-
'tokens' => array(
|
160 |
-
'comment.id' => $comment_id,
|
161 |
-
'commenter.id' => $commenter_id,
|
162 |
-
'usermessage' => wp_strip_all_tags( $content ),
|
163 |
-
'parent-comment-user.id' => $parent_comment->user_id,
|
164 |
-
'poster.name' => $poster_name,
|
165 |
-
'thread.url' => esc_url( $thread_link ),
|
166 |
-
),
|
167 |
-
);
|
168 |
-
|
169 |
-
bp_send_email( 'activity-comment-author', $parent_comment->user_id, $args );
|
170 |
-
}
|
171 |
-
|
172 |
-
/**
|
173 |
-
* Fires at the point that notifications should be sent for comments on activity replies.
|
174 |
-
*
|
175 |
-
* @since 2.6.0
|
176 |
-
*
|
177 |
-
* @param BP_Activity_Activity $parent_comment The parent activity.
|
178 |
-
* @param int $comment_id ID for the newly received comment.
|
179 |
-
* @param int $commenter_id ID of the user who made the comment.
|
180 |
-
* @param array $params Arguments used with the original activity comment.
|
181 |
-
*/
|
182 |
-
do_action( 'bp_activity_sent_reply_to_reply_notification', $parent_comment, $comment_id, $commenter_id, $params );
|
183 |
-
}
|
184 |
-
}
|
185 |
-
|
186 |
-
/**
|
187 |
-
* Helper method to map action arguments to function parameters.
|
188 |
-
*
|
189 |
-
* @since 1.9.0
|
190 |
-
*
|
191 |
-
* @param int $comment_id ID of the comment being notified about.
|
192 |
-
* @param array $params Parameters to use with notification.
|
193 |
-
*/
|
194 |
-
function bp_activity_new_comment_notification_helper( $comment_id, $params ) {
|
195 |
-
bp_activity_new_comment_notification( $comment_id, $params['user_id'], $params );
|
196 |
-
}
|
197 |
-
add_action( 'bp_activity_comment_posted', 'bp_activity_new_comment_notification_helper', 10, 2 );
|
198 |
-
|
199 |
-
/** Notifications *************************************************************/
|
200 |
-
|
201 |
/**
|
202 |
* Format notifications related to activity.
|
203 |
*
|
@@ -339,8 +151,7 @@ function bp_activity_format_notifications( $action, $item_id, $secondary_item_id
|
|
339 |
* @param int $receiver_user_id ID of user receiving notification.
|
340 |
*/
|
341 |
function bp_activity_at_mention_add_notification( $activity, $subject, $message, $content, $receiver_user_id ) {
|
342 |
-
|
343 |
-
bp_notifications_add_notification( array(
|
344 |
'user_id' => $receiver_user_id,
|
345 |
'item_id' => $activity->id,
|
346 |
'secondary_item_id' => $activity->user_id,
|
@@ -348,8 +159,7 @@ function bp_activity_at_mention_add_notification( $activity, $subject, $message,
|
|
348 |
'component_action' => 'new_at_mention',
|
349 |
'date_notified' => bp_core_current_time(),
|
350 |
'is_new' => 1,
|
351 |
-
|
352 |
-
}
|
353 |
}
|
354 |
add_action( 'bp_activity_sent_mention_email', 'bp_activity_at_mention_add_notification', 10, 5 );
|
355 |
|
@@ -363,17 +173,15 @@ add_action( 'bp_activity_sent_mention_email', 'bp_activity_at_mention_add_notifi
|
|
363 |
* @param int $commenter_id ID of the user who made the comment.
|
364 |
*/
|
365 |
function bp_activity_update_reply_add_notification( $activity, $comment_id, $commenter_id ) {
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
) );
|
376 |
-
}
|
377 |
}
|
378 |
add_action( 'bp_activity_sent_reply_to_update_notification', 'bp_activity_update_reply_add_notification', 10, 3 );
|
379 |
|
@@ -387,17 +195,15 @@ add_action( 'bp_activity_sent_reply_to_update_notification', 'bp_activity_update
|
|
387 |
* @param int $commenter_id ID of the user who made the comment.
|
388 |
*/
|
389 |
function bp_activity_comment_reply_add_notification( $activity_comment, $comment_id, $commenter_id ) {
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
) );
|
400 |
-
}
|
401 |
}
|
402 |
add_action( 'bp_activity_sent_reply_to_reply_notification', 'bp_activity_comment_reply_add_notification', 10, 3 );
|
403 |
|
@@ -410,10 +216,6 @@ add_action( 'bp_activity_sent_reply_to_reply_notification', 'bp_activity_comment
|
|
410 |
* @param int $user_id The id of the user whose notifications are marked as read.
|
411 |
*/
|
412 |
function bp_activity_remove_screen_notifications( $user_id = 0 ) {
|
413 |
-
if ( ! bp_is_active( 'notifications' ) ) {
|
414 |
-
return;
|
415 |
-
}
|
416 |
-
|
417 |
// Only mark read if the current user is looking at his own mentions.
|
418 |
if ( empty( $user_id ) || (int) $user_id !== (int) bp_loggedin_user_id() ) {
|
419 |
return;
|
@@ -431,10 +233,6 @@ add_action( 'bp_activity_clear_new_mentions', 'bp_activity_remove_screen_notific
|
|
431 |
* @param BP_Activity_Activity $activity Activity object.
|
432 |
*/
|
433 |
function bp_activity_remove_screen_notifications_single_activity_permalink( $activity ) {
|
434 |
-
if ( ! bp_is_active( 'notifications' ) ) {
|
435 |
-
return;
|
436 |
-
}
|
437 |
-
|
438 |
if ( ! is_user_logged_in() ) {
|
439 |
return;
|
440 |
}
|
@@ -453,7 +251,7 @@ add_action( 'bp_activity_screen_single_activity_permalink', 'bp_activity_remove_
|
|
453 |
* @since 2.6.0
|
454 |
*/
|
455 |
function bp_activity_remove_screen_notifications_for_non_mentions() {
|
456 |
-
if ( false ===
|
457 |
return;
|
458 |
}
|
459 |
|
@@ -480,7 +278,7 @@ add_action( 'bp_screens', 'bp_activity_remove_screen_notifications_for_non_menti
|
|
480 |
function bp_activity_at_mention_delete_notification( $activity_ids_deleted = array() ) {
|
481 |
// Let's delete all without checking if content contains any mentions
|
482 |
// to avoid a query to get the activity.
|
483 |
-
if (
|
484 |
foreach ( $activity_ids_deleted as $activity_id ) {
|
485 |
bp_notifications_delete_all_notifications_by_type( $activity_id, buddypress()->activity->id );
|
486 |
}
|
@@ -502,7 +300,7 @@ add_action( 'bp_activity_deleted_activities', 'bp_activity_at_mention_delete_not
|
|
502 |
*/
|
503 |
function bp_activity_add_notification_for_synced_blog_comment( $activity_id, $post_type_comment, $activity_args, $activity_post_object ) {
|
504 |
// If activity comments are disabled for WP posts, stop now!
|
505 |
-
if ( bp_disable_blogforum_comments() || empty( $activity_id )
|
506 |
return;
|
507 |
}
|
508 |
|
10 |
// Exit if accessed directly.
|
11 |
defined( 'ABSPATH' ) || exit;
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
/**
|
14 |
* Format notifications related to activity.
|
15 |
*
|
151 |
* @param int $receiver_user_id ID of user receiving notification.
|
152 |
*/
|
153 |
function bp_activity_at_mention_add_notification( $activity, $subject, $message, $content, $receiver_user_id ) {
|
154 |
+
bp_notifications_add_notification( array(
|
|
|
155 |
'user_id' => $receiver_user_id,
|
156 |
'item_id' => $activity->id,
|
157 |
'secondary_item_id' => $activity->user_id,
|
159 |
'component_action' => 'new_at_mention',
|
160 |
'date_notified' => bp_core_current_time(),
|
161 |
'is_new' => 1,
|
162 |
+
) );
|
|
|
163 |
}
|
164 |
add_action( 'bp_activity_sent_mention_email', 'bp_activity_at_mention_add_notification', 10, 5 );
|
165 |
|
173 |
* @param int $commenter_id ID of the user who made the comment.
|
174 |
*/
|
175 |
function bp_activity_update_reply_add_notification( $activity, $comment_id, $commenter_id ) {
|
176 |
+
bp_notifications_add_notification( array(
|
177 |
+
'user_id' => $activity->user_id,
|
178 |
+
'item_id' => $comment_id,
|
179 |
+
'secondary_item_id' => $commenter_id,
|
180 |
+
'component_name' => buddypress()->activity->id,
|
181 |
+
'component_action' => 'update_reply',
|
182 |
+
'date_notified' => bp_core_current_time(),
|
183 |
+
'is_new' => 1,
|
184 |
+
) );
|
|
|
|
|
185 |
}
|
186 |
add_action( 'bp_activity_sent_reply_to_update_notification', 'bp_activity_update_reply_add_notification', 10, 3 );
|
187 |
|
195 |
* @param int $commenter_id ID of the user who made the comment.
|
196 |
*/
|
197 |
function bp_activity_comment_reply_add_notification( $activity_comment, $comment_id, $commenter_id ) {
|
198 |
+
bp_notifications_add_notification( array(
|
199 |
+
'user_id' => $activity_comment->user_id,
|
200 |
+
'item_id' => $comment_id,
|
201 |
+
'secondary_item_id' => $commenter_id,
|
202 |
+
'component_name' => buddypress()->activity->id,
|
203 |
+
'component_action' => 'comment_reply',
|
204 |
+
'date_notified' => bp_core_current_time(),
|
205 |
+
'is_new' => 1,
|
206 |
+
) );
|
|
|
|
|
207 |
}
|
208 |
add_action( 'bp_activity_sent_reply_to_reply_notification', 'bp_activity_comment_reply_add_notification', 10, 3 );
|
209 |
|
216 |
* @param int $user_id The id of the user whose notifications are marked as read.
|
217 |
*/
|
218 |
function bp_activity_remove_screen_notifications( $user_id = 0 ) {
|
|
|
|
|
|
|
|
|
219 |
// Only mark read if the current user is looking at his own mentions.
|
220 |
if ( empty( $user_id ) || (int) $user_id !== (int) bp_loggedin_user_id() ) {
|
221 |
return;
|
233 |
* @param BP_Activity_Activity $activity Activity object.
|
234 |
*/
|
235 |
function bp_activity_remove_screen_notifications_single_activity_permalink( $activity ) {
|
|
|
|
|
|
|
|
|
236 |
if ( ! is_user_logged_in() ) {
|
237 |
return;
|
238 |
}
|
251 |
* @since 2.6.0
|
252 |
*/
|
253 |
function bp_activity_remove_screen_notifications_for_non_mentions() {
|
254 |
+
if ( false === is_singular() || false === is_user_logged_in() || empty( $_GET['nid'] ) ) {
|
255 |
return;
|
256 |
}
|
257 |
|
278 |
function bp_activity_at_mention_delete_notification( $activity_ids_deleted = array() ) {
|
279 |
// Let's delete all without checking if content contains any mentions
|
280 |
// to avoid a query to get the activity.
|
281 |
+
if ( ! empty( $activity_ids_deleted ) ) {
|
282 |
foreach ( $activity_ids_deleted as $activity_id ) {
|
283 |
bp_notifications_delete_all_notifications_by_type( $activity_id, buddypress()->activity->id );
|
284 |
}
|
300 |
*/
|
301 |
function bp_activity_add_notification_for_synced_blog_comment( $activity_id, $post_type_comment, $activity_args, $activity_post_object ) {
|
302 |
// If activity comments are disabled for WP posts, stop now!
|
303 |
+
if ( bp_disable_blogforum_comments() || empty( $activity_id ) ) {
|
304 |
return;
|
305 |
}
|
306 |
|
bp-activity/bp-activity-screens.php
CHANGED
@@ -236,7 +236,7 @@ function bp_activity_screen_single_activity_permalink() {
|
|
236 |
|
237 |
// Check to see if the group is not public, if so, check the
|
238 |
// user has access to see this activity.
|
239 |
-
if ( $group = groups_get_group(
|
240 |
|
241 |
// Group is not public.
|
242 |
if ( 'public' != $group->status ) {
|
236 |
|
237 |
// Check to see if the group is not public, if so, check the
|
238 |
// user has access to see this activity.
|
239 |
+
if ( $group = groups_get_group( $activity->item_id ) ) {
|
240 |
|
241 |
// Group is not public.
|
242 |
if ( 'public' != $group->status ) {
|
bp-activity/bp-activity-template.php
CHANGED
@@ -1177,11 +1177,7 @@ function bp_activity_secondary_avatar( $args = '' ) {
|
|
1177 |
|
1178 |
// Only if groups is active.
|
1179 |
if ( bp_is_active( 'groups' ) ) {
|
1180 |
-
$group = groups_get_group(
|
1181 |
-
'group_id' => $item_id,
|
1182 |
-
'populate_extras' => false,
|
1183 |
-
'update_meta_cache' => false,
|
1184 |
-
) );
|
1185 |
$link = bp_get_group_permalink( $group );
|
1186 |
$name = $group->name;
|
1187 |
}
|
@@ -1476,6 +1472,13 @@ function bp_insert_activity_meta( $content = '' ) {
|
|
1476 |
// Get the time since this activity was recorded.
|
1477 |
$date_recorded = bp_core_time_since( $activities_template->activity->date_recorded );
|
1478 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1479 |
/**
|
1480 |
* Filters the activity item time since markup.
|
1481 |
*
|
@@ -1484,7 +1487,7 @@ function bp_insert_activity_meta( $content = '' ) {
|
|
1484 |
* @param array $value Array containing the time since markup and the current activity component.
|
1485 |
*/
|
1486 |
$time_since = apply_filters_ref_array( 'bp_activity_time_since', array(
|
1487 |
-
|
1488 |
&$activities_template->activity
|
1489 |
) );
|
1490 |
|
@@ -1533,7 +1536,7 @@ function bp_insert_activity_meta( $content = '' ) {
|
|
1533 |
*
|
1534 |
* @global object $activities_template {@link BP_Activity_Template}
|
1535 |
*
|
1536 |
-
* @param
|
1537 |
* @return bool True if can delete, false otherwise.
|
1538 |
*/
|
1539 |
function bp_activity_user_can_delete( $activity = false ) {
|
@@ -2090,7 +2093,7 @@ function bp_activity_comment_delete_link() {
|
|
2090 |
* activity comment.
|
2091 |
*/
|
2092 |
function bp_get_activity_comment_delete_link() {
|
2093 |
-
$link = wp_nonce_url(
|
2094 |
|
2095 |
/**
|
2096 |
* Filters the link used for deleting the activity comment currently being displayed.
|
@@ -3162,8 +3165,6 @@ function bp_send_public_message_button( $args = '' ) {
|
|
3162 |
* @type string $wrapper_id Default: 'post-mention'.
|
3163 |
* @type string $link_href Default: the public message link for
|
3164 |
* the current member in the loop.
|
3165 |
-
* @type string $link_title Default: 'Send a public message on your
|
3166 |
-
* activity stream.'.
|
3167 |
* @type string $link_text Default: 'Public Message'.
|
3168 |
* @type string $link_class Default: 'activity-button mention'.
|
3169 |
* }
|
@@ -3178,7 +3179,6 @@ function bp_send_public_message_button( $args = '' ) {
|
|
3178 |
'block_self' => true,
|
3179 |
'wrapper_id' => 'post-mention',
|
3180 |
'link_href' => bp_get_send_public_message_link(),
|
3181 |
-
'link_title' => __( 'Send a public message on your activity stream.', 'buddypress' ),
|
3182 |
'link_text' => __( 'Public Message', 'buddypress' ),
|
3183 |
'link_class' => 'activity-button mention'
|
3184 |
) );
|
1177 |
|
1178 |
// Only if groups is active.
|
1179 |
if ( bp_is_active( 'groups' ) ) {
|
1180 |
+
$group = groups_get_group( $item_id );
|
|
|
|
|
|
|
|
|
1181 |
$link = bp_get_group_permalink( $group );
|
1182 |
$name = $group->name;
|
1183 |
}
|
1472 |
// Get the time since this activity was recorded.
|
1473 |
$date_recorded = bp_core_time_since( $activities_template->activity->date_recorded );
|
1474 |
|
1475 |
+
// Set up 'time-since' <span>.
|
1476 |
+
$time_since = sprintf(
|
1477 |
+
'<span class="time-since" data-livestamp="%1$s">%2$s</span>',
|
1478 |
+
bp_core_get_iso8601_date( $activities_template->activity->date_recorded ),
|
1479 |
+
$date_recorded
|
1480 |
+
);
|
1481 |
+
|
1482 |
/**
|
1483 |
* Filters the activity item time since markup.
|
1484 |
*
|
1487 |
* @param array $value Array containing the time since markup and the current activity component.
|
1488 |
*/
|
1489 |
$time_since = apply_filters_ref_array( 'bp_activity_time_since', array(
|
1490 |
+
$time_since,
|
1491 |
&$activities_template->activity
|
1492 |
) );
|
1493 |
|
1536 |
*
|
1537 |
* @global object $activities_template {@link BP_Activity_Template}
|
1538 |
*
|
1539 |
+
* @param BP_Activity_Activity $activity Optional. Falls back on the current item in the loop.
|
1540 |
* @return bool True if can delete, false otherwise.
|
1541 |
*/
|
1542 |
function bp_activity_user_can_delete( $activity = false ) {
|
2093 |
* activity comment.
|
2094 |
*/
|
2095 |
function bp_get_activity_comment_delete_link() {
|
2096 |
+
$link = wp_nonce_url( bp_get_activity_directory_permalink() . 'delete/' . bp_get_activity_comment_id() . '?cid=' . bp_get_activity_comment_id(), 'bp_activity_delete_link' );
|
2097 |
|
2098 |
/**
|
2099 |
* Filters the link used for deleting the activity comment currently being displayed.
|
3165 |
* @type string $wrapper_id Default: 'post-mention'.
|
3166 |
* @type string $link_href Default: the public message link for
|
3167 |
* the current member in the loop.
|
|
|
|
|
3168 |
* @type string $link_text Default: 'Public Message'.
|
3169 |
* @type string $link_class Default: 'activity-button mention'.
|
3170 |
* }
|
3179 |
'block_self' => true,
|
3180 |
'wrapper_id' => 'post-mention',
|
3181 |
'link_href' => bp_get_send_public_message_link(),
|
|
|
3182 |
'link_text' => __( 'Public Message', 'buddypress' ),
|
3183 |
'link_class' => 'activity-button mention'
|
3184 |
) );
|
bp-activity/classes/class-bp-activity-activity.php
CHANGED
@@ -645,7 +645,23 @@ class BP_Activity_Activity {
|
|
645 |
*/
|
646 |
$activity_ids_sql = apply_filters( 'bp_activity_paged_activities_sql', $activity_ids_sql, $r );
|
647 |
|
648 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
649 |
|
650 |
$retval['has_more_items'] = ! empty( $per_page ) && count( $activity_ids ) > $per_page;
|
651 |
|
@@ -702,7 +718,13 @@ class BP_Activity_Activity {
|
|
702 |
* @param string $sort Sort direction for query.
|
703 |
*/
|
704 |
$total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', "SELECT count(DISTINCT a.id) FROM {$bp->activity->table_name} a {$join_sql} {$where_sql}", $where_sql, $sort );
|
705 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
706 |
|
707 |
if ( !empty( $r['max'] ) ) {
|
708 |
if ( (int) $total_activities > (int) $r['max'] ) {
|
645 |
*/
|
646 |
$activity_ids_sql = apply_filters( 'bp_activity_paged_activities_sql', $activity_ids_sql, $r );
|
647 |
|
648 |
+
/*
|
649 |
+
* Queries that include 'last_activity' are cached separately,
|
650 |
+
* since they are generally much less long-lived.
|
651 |
+
*/
|
652 |
+
if ( preg_match( '/a\.type NOT IN \([^\)]*\'last_activity\'[^\)]*\)/', $activity_ids_sql ) ) {
|
653 |
+
$cache_group = 'bp_activity';
|
654 |
+
} else {
|
655 |
+
$cache_group = 'bp_activity_with_last_activity';
|
656 |
+
}
|
657 |
+
|
658 |
+
$cached = bp_core_get_incremented_cache( $activity_ids_sql, $cache_group );
|
659 |
+
if ( false === $cached ) {
|
660 |
+
$activity_ids = $wpdb->get_col( $activity_ids_sql );
|
661 |
+
bp_core_set_incremented_cache( $activity_ids_sql, $cache_group, $activity_ids );
|
662 |
+
} else {
|
663 |
+
$activity_ids = $cached;
|
664 |
+
}
|
665 |
|
666 |
$retval['has_more_items'] = ! empty( $per_page ) && count( $activity_ids ) > $per_page;
|
667 |
|
718 |
* @param string $sort Sort direction for query.
|
719 |
*/
|
720 |
$total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', "SELECT count(DISTINCT a.id) FROM {$bp->activity->table_name} a {$join_sql} {$where_sql}", $where_sql, $sort );
|
721 |
+
$cached = bp_core_get_incremented_cache( $total_activities_sql, $cache_group );
|
722 |
+
if ( false === $cached ) {
|
723 |
+
$total_activities = $wpdb->get_var( $total_activities_sql );
|
724 |
+
bp_core_set_incremented_cache( $total_activities_sql, $cache_group, $total_activities );
|
725 |
+
} else {
|
726 |
+
$total_activities = $cached;
|
727 |
+
}
|
728 |
|
729 |
if ( !empty( $r['max'] ) ) {
|
730 |
if ( (int) $total_activities > (int) $r['max'] ) {
|
bp-activity/classes/class-bp-activity-component.php
CHANGED
@@ -57,10 +57,14 @@ class BP_Activity_Component extends BP_Component {
|
|
57 |
'adminbar',
|
58 |
'template',
|
59 |
'functions',
|
60 |
-
'notifications',
|
61 |
'cache'
|
62 |
);
|
63 |
|
|
|
|
|
|
|
|
|
|
|
64 |
if ( ! buddypress()->do_autoload ) {
|
65 |
$includes[] = 'classes';
|
66 |
}
|
@@ -68,7 +72,7 @@ class BP_Activity_Component extends BP_Component {
|
|
68 |
// Load Akismet support if Akismet is configured.
|
69 |
$akismet_key = bp_get_option( 'wordpress_api_key' );
|
70 |
|
71 |
-
/** This filter is documented in bp-activity/bp-activity-
|
72 |
if ( defined( 'AKISMET_VERSION' ) && class_exists( 'Akismet' ) && ( ! empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) && apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) {
|
73 |
$includes[] = 'akismet';
|
74 |
}
|
@@ -116,13 +120,17 @@ class BP_Activity_Component extends BP_Component {
|
|
116 |
'activity' => $bp->table_prefix . 'bp_activity_meta',
|
117 |
);
|
118 |
|
|
|
|
|
|
|
|
|
119 |
// All globals for activity component.
|
120 |
// Note that global_tables is included in this array.
|
121 |
$args = array(
|
122 |
'slug' => BP_ACTIVITY_SLUG,
|
123 |
'root_slug' => isset( $bp->pages->activity->slug ) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG,
|
124 |
'has_directory' => true,
|
125 |
-
'directory_title' =>
|
126 |
'notification_callback' => 'bp_activity_format_notifications',
|
127 |
'search_string' => __( 'Search Activity...', 'buddypress' ),
|
128 |
'global_tables' => $global_tables,
|
@@ -361,19 +369,6 @@ class BP_Activity_Component extends BP_Component {
|
|
361 |
parent::setup_title();
|
362 |
}
|
363 |
|
364 |
-
/**
|
365 |
-
* Set up actions necessary for the component.
|
366 |
-
*
|
367 |
-
* @since 1.6.0
|
368 |
-
*/
|
369 |
-
public function setup_actions() {
|
370 |
-
|
371 |
-
// Spam prevention.
|
372 |
-
add_action( 'bp_include', 'bp_activity_setup_akismet' );
|
373 |
-
|
374 |
-
parent::setup_actions();
|
375 |
-
}
|
376 |
-
|
377 |
/**
|
378 |
* Setup cache groups.
|
379 |
*
|
57 |
'adminbar',
|
58 |
'template',
|
59 |
'functions',
|
|
|
60 |
'cache'
|
61 |
);
|
62 |
|
63 |
+
// Notifications support.
|
64 |
+
if ( bp_is_active( 'notifications' ) ) {
|
65 |
+
$includes[] = 'notifications';
|
66 |
+
}
|
67 |
+
|
68 |
if ( ! buddypress()->do_autoload ) {
|
69 |
$includes[] = 'classes';
|
70 |
}
|
72 |
// Load Akismet support if Akismet is configured.
|
73 |
$akismet_key = bp_get_option( 'wordpress_api_key' );
|
74 |
|
75 |
+
/** This filter is documented in bp-activity/bp-activity-akismet.php */
|
76 |
if ( defined( 'AKISMET_VERSION' ) && class_exists( 'Akismet' ) && ( ! empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) && apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) {
|
77 |
$includes[] = 'akismet';
|
78 |
}
|
120 |
'activity' => $bp->table_prefix . 'bp_activity_meta',
|
121 |
);
|
122 |
|
123 |
+
// Fetch the default directory title.
|
124 |
+
$default_directory_titles = bp_core_get_directory_page_default_titles();
|
125 |
+
$default_directory_title = $default_directory_titles[$this->id];
|
126 |
+
|
127 |
// All globals for activity component.
|
128 |
// Note that global_tables is included in this array.
|
129 |
$args = array(
|
130 |
'slug' => BP_ACTIVITY_SLUG,
|
131 |
'root_slug' => isset( $bp->pages->activity->slug ) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG,
|
132 |
'has_directory' => true,
|
133 |
+
'directory_title' => isset( $bp->pages->activity->title ) ? $bp->pages->activity->title : $default_directory_title,
|
134 |
'notification_callback' => 'bp_activity_format_notifications',
|
135 |
'search_string' => __( 'Search Activity...', 'buddypress' ),
|
136 |
'global_tables' => $global_tables,
|
369 |
parent::setup_title();
|
370 |
}
|
371 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
/**
|
373 |
* Setup cache groups.
|
374 |
*
|
bp-activity/classes/class-bp-activity-list-table.php
CHANGED
@@ -428,8 +428,26 @@ class BP_Activity_List_Table extends WP_List_Table {
|
|
428 |
<option value="" <?php selected( ! $selected ); ?>><?php _e( 'View all actions', 'buddypress' ); ?></option>
|
429 |
|
430 |
<?php foreach ( $activity_actions as $component => $actions ) : ?>
|
431 |
-
|
432 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
433 |
|
434 |
<?php foreach ( $actions as $action_key => $action_values ) : ?>
|
435 |
|
428 |
<option value="" <?php selected( ! $selected ); ?>><?php _e( 'View all actions', 'buddypress' ); ?></option>
|
429 |
|
430 |
<?php foreach ( $activity_actions as $component => $actions ) : ?>
|
431 |
+
<?php
|
432 |
+
// Older avatar activity items use 'profile' for component. See r4273.
|
433 |
+
if ( $component === 'profile' ) {
|
434 |
+
$component = 'xprofile';
|
435 |
+
}
|
436 |
+
|
437 |
+
if ( bp_is_active( $component ) ) {
|
438 |
+
if ( $component === 'xprofile' ) {
|
439 |
+
$component_name = buddypress()->profile->name;
|
440 |
+
} else {
|
441 |
+
$component_name = buddypress()->$component->name;
|
442 |
+
}
|
443 |
+
|
444 |
+
} else {
|
445 |
+
// Prevent warnings by other plugins if a component is disabled but the activity type has been registered.
|
446 |
+
$component_name = ucfirst( $component );
|
447 |
+
}
|
448 |
+
?>
|
449 |
+
|
450 |
+
<optgroup label="<?php echo esc_html( $component_name ); ?>">
|
451 |
|
452 |
<?php foreach ( $actions as $action_key => $action_values ) : ?>
|
453 |
|
bp-activity/js/mentions.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
window.bp=window.bp||{},function(a,b,c){var d,e=[];a.mentions=a.mentions||{},a.mentions.users=window.bp.mentions.users||[],"object"==typeof window.BP_Suggestions&&(a.mentions.users=window.BP_Suggestions.friends||a.mentions.users),b.fn.bp_mentions=function(a){b.isArray(a)&&(a={data:a});var c={delay:200,hide_without_suffix:!0,insert_tpl:"</>${atwho-data-value}</>",limit:10,start_with_space:!1,suffix:"",callbacks:{filter:function(a,b,c){var d,e,f,g=[],h=new RegExp("^"+a+"| "+a,"ig");for(e=0,f=b.length;f
|
1 |
+
window.bp=window.bp||{},function(a,b,c){var d,e=[];a.mentions=a.mentions||{},a.mentions.users=window.bp.mentions.users||[],"object"==typeof window.BP_Suggestions&&(a.mentions.users=window.BP_Suggestions.friends||a.mentions.users),b.fn.bp_mentions=function(a){b.isArray(a)&&(a={data:a});var c={delay:200,hide_without_suffix:!0,insert_tpl:"</>${atwho-data-value}</>",limit:10,start_with_space:!1,suffix:"",callbacks:{filter:function(a,b,c){var d,e,f,g=[],h=new RegExp("^"+a+"| "+a,"ig");for(e=0,f=b.length;e<f;e++)d=b[e],d[c].toLowerCase().match(h)&&g.push(d);return g},highlighter:function(a,b){if(!b)return a;var c=new RegExp(">(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+b.replace("+","\\+")+")([\\w ]*)\\s*<","ig");return a.replace(c,function(a,b,c,d){return">"+b+"<strong>"+c+"</strong>"+d+"<"})},before_reposition:function(a){var c,d,e,f,g=b("#atwho-ground-"+this.id+" .atwho-view"),h=b("body"),i=this.$inputor.data("atwho");"undefined"!==i&&"undefined"!==i.iframe&&null!==i.iframe?(c=this.$inputor.caret("offset",{iframe:i.iframe}),e=b(i.iframe).offset(),"undefined"!==e&&(c.left+=e.left,c.top+=e.top)):c=this.$inputor.caret("offset"),c.left>h.width()/2?(g.addClass("right"),f=c.left-a.left-this.view.$el.width()):(g.removeClass("right"),f=c.left-a.left+1),h.width()<=400&&b(document).scrollTop(c.top-6),d=parseInt(this.$inputor.css("line-height").substr(0,this.$inputor.css("line-height").length-2),10),(!d||d<5)&&(d=19),a.top=c.top+d,a.left+=f},inserting_wrapper:function(a,b,c){return""+b+c}}},f={callbacks:{remote_filter:function(a,c){var f=b(this),g={};return d=e[a],"object"==typeof d?void c(d):(f.xhr&&f.xhr.abort(),g={action:"bp_get_suggestions",term:a,type:"members"},b.isNumeric(this.$inputor.data("suggestions-group-id"))&&(g["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),void(f.xhr=b.getJSON(ajaxurl,g).done(function(d){if(d.success){var f=b.map(d.data,function(a){return a.search=a.search||a.ID+" "+a.name,a});e[a]=f,c(f)}})))}},data:b.map(a.data,function(a){return a.search=a.search||a.ID+" "+a.name,a}),at:"@",search_key:"search",tpl:'<li data-value="@${ID}"><img src="${image}" /><span class="username">@${ID}</span><small>${name}</small></li>'},g=b.extend(!0,{},c,f,a);return b.fn.atwho.call(this,g)},b(document).ready(function(){b(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(a.mentions.users)}),a.mentions.tinyMCEinit=function(){"undefined"!=typeof window.tinyMCE&&null!==window.tinyMCE.activeEditor&&"undefined"!=typeof window.tinyMCE.activeEditor&&b(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",b(".wp-editor-wrap iframe")[0]).bp_mentions(a.mentions.users)}}(bp,jQuery);
|
bp-blogs/bp-blogs-activity.php
CHANGED
@@ -1291,7 +1291,7 @@ function bp_blogs_can_comment_reply( $retval, $comment ) {
|
|
1291 |
|
1292 |
// Check comment depth and disable if depth is too large.
|
1293 |
if ( isset( buddypress()->blogs->thread_depth[$comment->item_id] ) ){
|
1294 |
-
if (
|
1295 |
$retval = false;
|
1296 |
}
|
1297 |
}
|
1291 |
|
1292 |
// Check comment depth and disable if depth is too large.
|
1293 |
if ( isset( buddypress()->blogs->thread_depth[$comment->item_id] ) ){
|
1294 |
+
if ( bp_activity_get_comment_depth() > buddypress()->blogs->thread_depth[$comment->item_id] ) {
|
1295 |
$retval = false;
|
1296 |
}
|
1297 |
}
|
bp-blogs/bp-blogs-filters.php
CHANGED
@@ -121,3 +121,17 @@ function bp_blogs_post_pre_publish( $return = true, $blog_id = 0, $post_id = 0,
|
|
121 |
}
|
122 |
add_filter( 'bp_activity_post_pre_publish', 'bp_blogs_post_pre_publish', 10, 4 );
|
123 |
add_filter( 'bp_activity_post_pre_comment', 'bp_blogs_post_pre_publish', 10, 4 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
}
|
122 |
add_filter( 'bp_activity_post_pre_publish', 'bp_blogs_post_pre_publish', 10, 4 );
|
123 |
add_filter( 'bp_activity_post_pre_comment', 'bp_blogs_post_pre_publish', 10, 4 );
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Registers our custom thumb size with WP's Site Icon feature.
|
127 |
+
*
|
128 |
+
* @since 2.7.0
|
129 |
+
*
|
130 |
+
* @param array $sizes Current array of custom site icon sizes.
|
131 |
+
* @return array
|
132 |
+
*/
|
133 |
+
function bp_blogs_register_custom_site_icon_size( $sizes ) {
|
134 |
+
$sizes[] = bp_core_avatar_thumb_width();
|
135 |
+
return $sizes;
|
136 |
+
}
|
137 |
+
add_filter( 'site_icon_image_sizes', 'bp_blogs_register_custom_site_icon_size' );
|
bp-blogs/bp-blogs-functions.php
CHANGED
@@ -475,6 +475,26 @@ function bp_blogs_update_option_thread_comments_depth( $oldvalue, $newvalue ) {
|
|
475 |
}
|
476 |
add_action( 'update_option_thread_comments_depth', 'bp_blogs_update_option_thread_comments_depth', 10, 2 );
|
477 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
478 |
/**
|
479 |
* Deletes the 'url' blogmeta for a site.
|
480 |
*
|
475 |
}
|
476 |
add_action( 'update_option_thread_comments_depth', 'bp_blogs_update_option_thread_comments_depth', 10, 2 );
|
477 |
|
478 |
+
/**
|
479 |
+
* Syncs site icon URLs to blogmeta.
|
480 |
+
*
|
481 |
+
* @since 2.7.0
|
482 |
+
*
|
483 |
+
* @param int|string $old_value Old value
|
484 |
+
* @param int|string $new_value New value
|
485 |
+
*/
|
486 |
+
function bp_blogs_update_option_site_icon( $old_value, $new_value ) {
|
487 |
+
if ( 0 === $new_value ) {
|
488 |
+
bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_thumb', 0 );
|
489 |
+
bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_full', 0 );
|
490 |
+
} else {
|
491 |
+
// Save site icon URL as blogmeta.
|
492 |
+
bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_thumb', get_site_icon_url( bp_core_avatar_thumb_width() ) );
|
493 |
+
bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_full', get_site_icon_url( bp_core_avatar_full_width() ) );
|
494 |
+
}
|
495 |
+
}
|
496 |
+
add_action( 'update_option_site_icon', 'bp_blogs_update_option_site_icon', 10, 2 );
|
497 |
+
|
498 |
/**
|
499 |
* Deletes the 'url' blogmeta for a site.
|
500 |
*
|
bp-blogs/bp-blogs-loader.php
CHANGED
@@ -20,6 +20,8 @@ if ( ! buddypress()->do_autoload ) {
|
|
20 |
|
21 |
/**
|
22 |
* Set up the bp-blogs component.
|
|
|
|
|
23 |
*/
|
24 |
function bp_setup_blogs() {
|
25 |
buddypress()->blogs = new BP_Blogs_Component();
|
20 |
|
21 |
/**
|
22 |
* Set up the bp-blogs component.
|
23 |
+
*
|
24 |
+
* @since 1.5.0
|
25 |
*/
|
26 |
function bp_setup_blogs() {
|
27 |
buddypress()->blogs = new BP_Blogs_Component();
|
bp-blogs/bp-blogs-template.php
CHANGED
@@ -220,9 +220,20 @@ function bp_the_blog() {
|
|
220 |
/**
|
221 |
* Output the blogs pagination count.
|
222 |
*
|
223 |
-
* @
|
224 |
*/
|
225 |
function bp_blogs_pagination_count() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
global $blogs_template;
|
227 |
|
228 |
$start_num = intval( ( $blogs_template->pag_page - 1 ) * $blogs_template->pag_num ) + 1;
|
@@ -236,7 +247,17 @@ function bp_blogs_pagination_count() {
|
|
236 |
$message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s site', 'Viewing %1$s - %2$s of %3$s sites', $blogs_template->total_blog_count, 'buddypress' ), $from_num, $to_num, $total );
|
237 |
}
|
238 |
|
239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
}
|
241 |
|
242 |
/**
|
@@ -324,19 +345,77 @@ function bp_blog_avatar( $args = '' ) {
|
|
324 |
'no_grav' => true,
|
325 |
) );
|
326 |
|
327 |
-
//
|
328 |
-
$avatar =
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
//
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
|
341 |
/**
|
342 |
* In future BuddyPress versions you will be able to set the avatar for a blog.
|
@@ -1032,9 +1111,8 @@ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' )
|
|
1032 |
echo '<input name="blog_title" type="text" id="blog_title" value="'.esc_html($blog_title, 1).'" /></p>';
|
1033 |
?>
|
1034 |
|
1035 |
-
<
|
1036 |
-
<
|
1037 |
-
<?php _e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?>
|
1038 |
|
1039 |
<label class="checkbox" for="blog_public_on">
|
1040 |
<input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if( !isset( $_POST['blog_public'] ) || '1' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
|
@@ -1044,7 +1122,7 @@ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' )
|
|
1044 |
<input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
|
1045 |
<strong><?php _e( 'No' , 'buddypress'); ?></strong>
|
1046 |
</label>
|
1047 |
-
</
|
1048 |
|
1049 |
<?php
|
1050 |
|
@@ -1280,7 +1358,6 @@ function bp_blog_create_button() {
|
|
1280 |
'id' => 'create_blog',
|
1281 |
'component' => 'blogs',
|
1282 |
'link_text' => __( 'Create a Site', 'buddypress' ),
|
1283 |
-
'link_title' => __( 'Create a Site', 'buddypress' ),
|
1284 |
'link_class' => 'blog-create no-ajax',
|
1285 |
'link_href' => trailingslashit( bp_get_blogs_directory_permalink() . 'create' ),
|
1286 |
'wrapper' => false,
|
@@ -1377,7 +1454,6 @@ function bp_blogs_visit_blog_button( $args = '' ) {
|
|
1377 |
* @type string $link_href Permalink of the current blog in the loop.
|
1378 |
* @type string $link_class Default: 'blog-button visit'.
|
1379 |
* @type string $link_text Default: 'Visit Site'.
|
1380 |
-
* @type string $link_title Default: 'Visit Site'.
|
1381 |
* }
|
1382 |
* @return string The HTML for the Visit button.
|
1383 |
*/
|
@@ -1391,7 +1467,6 @@ function bp_blogs_visit_blog_button( $args = '' ) {
|
|
1391 |
'link_href' => bp_get_blog_permalink(),
|
1392 |
'link_class' => 'blog-button visit',
|
1393 |
'link_text' => __( 'Visit Site', 'buddypress' ),
|
1394 |
-
'link_title' => __( 'Visit Site', 'buddypress' ),
|
1395 |
);
|
1396 |
|
1397 |
$button = wp_parse_args( $args, $defaults );
|
220 |
/**
|
221 |
* Output the blogs pagination count.
|
222 |
*
|
223 |
+
* @since 1.0.0
|
224 |
*/
|
225 |
function bp_blogs_pagination_count() {
|
226 |
+
echo bp_get_blogs_pagination_count();
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Get the blogs pagination count.
|
231 |
+
*
|
232 |
+
* @since 2.7.0
|
233 |
+
*
|
234 |
+
* @global object $blogs_template {@link BP_Blogs_Template}
|
235 |
+
*/
|
236 |
+
function bp_get_blogs_pagination_count() {
|
237 |
global $blogs_template;
|
238 |
|
239 |
$start_num = intval( ( $blogs_template->pag_page - 1 ) * $blogs_template->pag_num ) + 1;
|
247 |
$message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s site', 'Viewing %1$s - %2$s of %3$s sites', $blogs_template->total_blog_count, 'buddypress' ), $from_num, $to_num, $total );
|
248 |
}
|
249 |
|
250 |
+
/**
|
251 |
+
* Filters the "Viewing x-y of z blogs" pagination message.
|
252 |
+
*
|
253 |
+
* @since 2.7.0
|
254 |
+
*
|
255 |
+
* @param string $message "Viewing x-y of z blogs" text.
|
256 |
+
* @param string $from_num Total amount for the low value in the range.
|
257 |
+
* @param string $to_num Total amount for the high value in the range.
|
258 |
+
* @param string $total Total amount of blogs found.
|
259 |
+
*/
|
260 |
+
return apply_filters( 'bp_get_blogs_pagination_count', $message, $from_num, $to_num, $total );
|
261 |
}
|
262 |
|
263 |
/**
|
345 |
'no_grav' => true,
|
346 |
) );
|
347 |
|
348 |
+
// Use site icon if available.
|
349 |
+
$avatar = '';
|
350 |
+
if ( bp_is_active( 'blogs', 'site-icon' ) && function_exists( 'has_site_icon' ) ) {
|
351 |
+
$site_icon = bp_blogs_get_blogmeta( bp_get_blog_id(), "site_icon_url_{$r['type']}" );
|
352 |
+
|
353 |
+
// Never attempted to fetch site icon before; do it now!
|
354 |
+
if ( '' === $site_icon ) {
|
355 |
+
switch_to_blog( bp_get_blog_id() );
|
356 |
+
|
357 |
+
// Fetch the other size first.
|
358 |
+
if ( 'full' === $r['type'] ) {
|
359 |
+
$size = bp_core_avatar_thumb_width();
|
360 |
+
$save_size = 'thumb';
|
361 |
+
} else {
|
362 |
+
$size = bp_core_avatar_full_width();
|
363 |
+
$save_size = 'full';
|
364 |
+
}
|
365 |
+
|
366 |
+
$site_icon = get_site_icon_url( $size );
|
367 |
+
// Empty site icons get saved as integer 0.
|
368 |
+
if ( empty( $site_icon ) ) {
|
369 |
+
$site_icon = 0;
|
370 |
+
}
|
371 |
+
|
372 |
+
// Sync site icon for other size to blogmeta.
|
373 |
+
bp_blogs_update_blogmeta( bp_get_blog_id(), "site_icon_url_{$save_size}", $site_icon );
|
374 |
+
|
375 |
+
// Now, fetch the size we want.
|
376 |
+
if ( 0 !== $site_icon ) {
|
377 |
+
$size = 'full' === $r['type'] ? bp_core_avatar_full_width() : bp_core_avatar_thumb_width();
|
378 |
+
$site_icon = get_site_icon_url( $size );
|
379 |
+
}
|
380 |
+
|
381 |
+
// Sync site icon to blogmeta.
|
382 |
+
bp_blogs_update_blogmeta( bp_get_blog_id(), "site_icon_url_{$r['type']}", $site_icon );
|
383 |
+
|
384 |
+
restore_current_blog();
|
385 |
+
}
|
386 |
+
|
387 |
+
// We have a site icon.
|
388 |
+
if ( ! is_numeric( $site_icon ) ) {
|
389 |
+
if ( empty( $r['width'] ) && ! isset( $size ) ) {
|
390 |
+
$size = 'full' === $r['type'] ? bp_core_avatar_full_width() : bp_core_avatar_thumb_width();
|
391 |
+
} else {
|
392 |
+
$size = (int) $r['width'];
|
393 |
+
}
|
394 |
+
|
395 |
+
$avatar = sprintf( '<img src="%1$s" class="%2$s" width="%3$s" height="%3$s" alt="%4$s" title="%4$s" />',
|
396 |
+
esc_url( $site_icon ),
|
397 |
+
esc_attr( "{$r['class']} avatar-{$size}" ),
|
398 |
+
esc_attr( $size ),
|
399 |
+
sprintf( esc_attr__( 'Site icon for %s', 'buddypress' ), bp_get_blog_name() )
|
400 |
+
);
|
401 |
+
}
|
402 |
+
}
|
403 |
+
|
404 |
+
// Fallback to user ID avatar.
|
405 |
+
if ( '' === $avatar ) {
|
406 |
+
$avatar = bp_core_fetch_avatar( array(
|
407 |
+
'item_id' => $blogs_template->blog->admin_user_id,
|
408 |
+
'title' => $r['title'],
|
409 |
+
// 'avatar_dir' => 'blog-avatars',
|
410 |
+
// 'object' => 'blog',
|
411 |
+
'type' => $r['type'],
|
412 |
+
'alt' => $r['alt'],
|
413 |
+
'css_id' => $r['id'],
|
414 |
+
'class' => $r['class'],
|
415 |
+
'width' => $r['width'],
|
416 |
+
'height' => $r['height']
|
417 |
+
) );
|
418 |
+
}
|
419 |
|
420 |
/**
|
421 |
* In future BuddyPress versions you will be able to set the avatar for a blog.
|
1111 |
echo '<input name="blog_title" type="text" id="blog_title" value="'.esc_html($blog_title, 1).'" /></p>';
|
1112 |
?>
|
1113 |
|
1114 |
+
<fieldset class="create-site">
|
1115 |
+
<legend class="label"><?php _e('Privacy: I would like my site to appear in search engines, and in public listings around this network', 'buddypress') ?></legend>
|
|
|
1116 |
|
1117 |
<label class="checkbox" for="blog_public_on">
|
1118 |
<input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if( !isset( $_POST['blog_public'] ) || '1' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
|
1122 |
<input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
|