Skip to main content Skip to navigation Skip to footer

Useful Functions

Updated

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

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.

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

If you’d like more control over the notifications from your front-end form, please see this support document on how to trigger a notification using an ACF front-end from.

add_filter( 'bnfw_trigger_insert_post', '__return_true' );
Remove the Global Override Add-on ‘Notifications’ Metabox from a Custom Post Type

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

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 );

Password Reset URL Filter

@param string $key The activation key.
@param string $user_login The username for the user.
@param WP_User $user_data WP_User object.
function my_bnfw_password_reset_link( $key, $user_login, $user_data ) {
$link = "wp-login.php?action=rp&login=" . rawurlencode( $user_login ), $key, $user_login, $user_data;
return $link;
}
add_filter( 'bnfw_password_reset_link', 'my_bnfw_password_reset_link' );

Privacy Overview

This website uses cookies so that it can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to this website and helping employees to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

This website uses the Stripe Payment Processor. Cookies from Stripe are required in order for this website to provide eCommerce functions, such as to accept payments.

This website uses YouTube to host and display videos relating to the operation of this plugin and forms part of the documentation. Use of cookies from YouTube is required in order to fully document or explain elements of a product.

PHPSESSID - This cookie is native to PHP applications. The cookie is used to store and identify a users' unique session ID for the purpose of managing a user's session on the website. The cookie is a session cookies and is deleted when all the browser windows are closed.