Hooks & Filters
If you need to use code to display a Notibar, we will give you 2 simple snippets. Make sure the Notibar plugin is active on your website.
1. Simple Integration
Feel free to edit the content as you need.
add_action( 'init', function() {
// Bail gracefully if Notibar isn't active.
if ( ! function_exists( 'njt_nofi_register_bar' ) ) {
return;
}
njt_nofi_register_bar( [
// REQUIRED — stable, unique, charset [A-Za-z0-9_-]. Powers the dismissal
// cookie + data-bar-id. Invalid/missing id → bar dropped. Colliding with a
// native (admin) bar id → dropped (native always wins).
'id' => 'free-shipping-2026',
'name' => 'Free shipping', // OPTIONAL string ≤100. Admin label only; not shown on fronten notification bar".
'enabled' => true, // OPTIONAL bool. Default true. false = registered but not rend
'order' => 0, // OPTIONAL int. Default 0. NOTE: no effect for injected bars — render after native, in declaration order.
// ----- content -----------------------------------------------------
'content' => [
'text' => 'Free shipping all weekend! 🚚', // OPTIONAL string, HTML allowed (wp_ks message. Default placeholder text.
'button' => [ // OPTIONAL object — desktop CTA button
'enabled' => true, // OPTIONAL bool. Default true. fal
'text' => 'Shop now', // OPTIONAL string ≤200. Default "L
'url' => home_url( '/shop' ), // OPTIONAL URL (esc_url_raw). Defa
'fontWeight' => 500, // OPTIONAL one of 100,200,300,400,500.
'newWindow' => false, // OPTIONAL bool. Default true. Ope
],
],
] );
} );2. Advanced Integration
You can tweak the code further to make it unique based on your requirements.
If you still need help, feel free to contact us.
Last updated