-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run WordCamp Participation Notifier when post is published #964
base: production
Are you sure you want to change the base?
Conversation
…dge notifications
`is_post_notifiable()` was returning `false` because the passed `id` wan't a `WP_Post`
I pushed 02ae763 to fix a problem that was preventing my tests from working. I'm seeing another problem now, but it doesn't seem to be in the PR. The CLI command also doesn't remove it either, though: > wp bp group member remove --group-id=wordcamp-organizer --user-id=13904193
Error: Could not remove member from the group. ( The SQL query in I'm a bit stuck there, so I'm gonna move on to other tests and try again next week. |
🤔 it seems like the reason why After setting After removing that code, though, I can still reproduce the error:
I'm gonna look and see if it's a bug in BuddyPress, or some conflict with our custom code/environment. |
It looks like it was a BuddyPress bug, so I filed a report. I'll see if there's a good workaround. If not we may be need to wait until it's fixed. |
Looks like this was released in https://buddypress.trac.wordpress.org/changeset/13592, so we can test this again. |
WordCamp Participation Notifier sends profile activity log messages and hands out the badges for organisers and speakers, in the future possibly for volunteers and attendees as well.
The notifier relied on
add_post_meta
andupdate_post_meta
hooks to detect when the notifications for profiles.wordpress.org should be sent. This has proven to cause problems, as many WordCamps do fill out the WordPress.org username for the post when they draft it. That has caused the filters to run, but bail because the post isn't public yet. In the end, people haven't received their badges or organisers have had to empty the username field, save and fill in the username again to send notifications.This PR tries to fix that by hooking into
wp_after_insert_post
action that is run after the post itself and related meta have been saved. If all conditions are met (not revision, published, notifiable post type) then notifications are sent.The
username_meta_update
function was left because it is used to notify about a mentor assigned to a WordCamp, which has a bit different logic.Someone with sandbox needs to test this and see that activity log and badges do in fact get assigned.
Fixes #809
Props @vertizio, @CdrMarks
How to test the changes in this Pull Request: