How can I make my plugin/theme work with BNFW?

BNFW utilises WordPress actions to trigger these emails and send them out. If an action already causes an email to send within WordPress by default (such as when a new user registers and an email is sent to the site admin) BNFW will use a filter to change the contents of this email with the one you set-up.

Both the actions and filters that BNFW uses are the ones made available within WordPress core and as such, this provides the most compatible way to create consist and desired notifications within WordPress. You won’t find any hacky, bodged, or duct-tape solutions within Better Notifications for WordPress! Not all plugins or themes are made this way though – some don’t adhere to best practices or recommended methods of triggering emails and as such, compatibility between BNFW and other plugins can vary greatly. When developing or looking for a plugin or theme that works well with WordPress and BNFW, look for one from a good developer, that provides good support, and regular or frequent updates.

For reference, best practices for correctly triggering notifications using WordPress and BNFW are:

Posts / Pages / Custom Post Types

When adding posts/pages/custom post types, don’t add them directly to the database. Instead, use wp_insert_post with the appropriate post status and update the post to the final post status using the correct post status transition. This ensures BNFW can detect a new post and which post status notification should be triggered for it.

Comments

When adding new comments, use wp_new_comment instead of wp_insert_comment. This is because wp_new_command sanitizes and validates comment data and then internally calls wp_insert_comment.

Users

When adding users, don’t add them directly to the database, use the wp_insert_user and wp_update_user functions.

Subscribe for BNFW News

Want to know when new add-ons or features are released? Sign up to the newsletter. No spam, ever. Unsubscribe at any time.

Please enter your name.
Please enter a valid email address.
Something went wrong. Please check your entries and try again.
The BNFW office will be closed for my annual Summer Holiday from 9th June 2018 - 24th June 2018 inclusive.
All support tickets will be replied to in order received on my return.