Useful Functions

Although these are scattered throughout the documentation on the relevant pages, here is a useful list of BNFW functions that provide support with other plugins:

 

Add Support for Gravity Forms User Registration Add-on

1
2
3
4
5
if ( ! function_exists( 'gf_new_user_notification' ) ) {
function gf_new_user_notification( $user_id, $plaintext_pass = '', $notify = '' ) {
wp_new_user_notification( $user_id, null, $notify ? $notify : ! empty( $plaintext_pass ) );
}
}

 

Add Support for Themes with Front-end Forms

Please note, this is for themes only. For plugins, please see the next filter, below.

1
2
3
4
5
function bnfw_insert_post_hook_for_theme( $themes ) {
$themes[] = 'theme_name';
return $themes;
}
add_filter( 'bnfw_insert_post_themes', 'bnfw_insert_post_hook_for_theme' );

 

Add Support for Plugins with Front-end Forms

1
add_filter( 'bnfw_trigger_insert_post', '__return_true' );

 

Remove the Global Override Add-on ‘Notifications’ Metabox from a Custom Post Type

1
2
3
4
function bnfw_ignore_cpt( $cpts ) {
$cpts = 'cpt_to_be_ignored';
}
add_filter( 'bnfw_ppo_ignore_cpt', 'bnfw_ignore_cpt' );

 

Improve Handling of Responsive Images in Email Message Body

1
2
3
4
function my_bnfw_responsive_html_images( $message, $setting ) {
$message = str_replace( "<img src="", "<img style="width: 100% !important;" src="", $message ); return $message;
}
add_filter( 'bnfw_notification_message', 'my_bnfw_responsive_html_images', 10, 2 );

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.