[buddypress-trac] [BuddyPress Trac] #8774: Add ability to change Email notification settings via REST API
buddypress-trac
noreply at wordpress.org
Sun Apr 14 16:48:07 UTC 2024
#8774: Add ability to change Email notification settings via REST API
--------------------------------------+--------------------------
Reporter: niftythree | Owner: espellcaste
Type: feature request | Status: assigned
Priority: high | Milestone: Up Next
Component: REST API | Version: 10.6.0
Severity: normal | Resolution:
Keywords: needs-patch has-dev-note |
--------------------------------------+--------------------------
Changes (by espellcaste):
* keywords: needs-patch => needs-patch has-dev-note
* priority: normal => high
* type: enhancement => feature request
* milestone: 14.0.0 => Up Next
Comment:
I'd like to propose we punt this ticket a bit more because there are
several unkowns here that increases the possibility of building something
that might introduce a breaking change later. And since this is the REST
API, it is more problematic (the sames problems here would affect the
[https://github.com/buddypress/wp-cli-buddypress BP CLI API] or the
[https://github.com/renatonascalves/wp-graphql-buddypress GraphQL API]).
Adding an endpoint to update the email notifications is straightforward.
But there are a few reasons or things we need to iron out first:
- The shape/schema of this endpoint can change considerably via #6712;
- We need to approach this via a "global" `settings` endpoint with child
endpoints:
{{{
https://wp.test/wp-json/buddypress/v1/settings/notifications
https://wp.test/wp-json/buddypress/v1/settings/profile
https://wp.test/wp-json/buddypress/v1/settings/general
...
}}}
- Ideally, the content of the settings would reflect the one in the site.
But currently, this information is hardcoded in template files. There is
no API to fetch it. That would force consumers to add it by hand.
[https://github.com/search?q=repo%3Abuddypress%2Fbuddypress%20bp_notification_settings&type=code
See]
That includes to the data location.
[https://github.com/buddypress/buddypress/blob/ef9fde9191b87a2f6a4027f2ecc75cfc1c616090/src
/bp-groups/bp-groups-notifications.php#L1163-L1176 See]
We need something like the Components component, where one can get the
data of the component easily (without being saved in the database).
[https://github.com/buddypress/buddypress/blob/a794a0b6cc0dc9b8fcde12927c3c7067b14c8ee5/src
/bp-core/bp-core-functions.php#L2681 See.]
- Support for plugins and developers to modify or add new sections. #6712
should take care of that. Or see how `bp_core_get_components` handles it.
----
For this reason, I'm punting this ticket to the next version together with
#6712
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8774#comment:8>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list