bbPress Notify (No-Spam) Shortcode

Below, you’ll find a detailed guide on how to add the bbPress Notify (No-Spam) Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the bbPress Notify (No-Spam) Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the bbPress Notify (No-Spam) Plugin and the shortcodes it provides:

Plugin Icon
bbPress Notify (No-Spam)

"bbPress Notify (No-Spam) is a powerful WordPress plugin that enhances your forum's communication by sending notifications without spamming. Keep your community active and engaged with bbpress-notify-nospam."

★★★★☆ (38) Active Installs: 4000+ Tested with: 6.2.3 PHP Version: 5.6
Included Shortcodes:
  • [bbpnns_date]

bbPress Notify (No-Spam) [bbpnns_date] Shortcode

The bbpress-notify-nospam shortcode, ‘bbpnns_date’, is used to display the current date and time. It utilizes the ‘date_format’ and ‘time_format’ settings from your WordPress site. The PHP function ‘_process_date_tag’ processes the shortcode. It takes ‘format’ as an attribute, which defaults to your site’s date and time settings. The function returns the current date and time in the specified format.

Shortcode: [bbpnns_date]

Parameters

Here is a list of all possible bbpnns_date shortcode parameters and attributes:

  • format – specifies the date and time format to display

Examples and Usage

Basic example – The bbpnns_date shortcode displays the current date and time using the format set in the WordPress settings.

[bbpnns_date /]

Advanced examples

Using the shortcode with a custom date format. You can specify your own date format by passing the ‘format’ attribute to the shortcode. In this example, the date will be displayed in the ‘Y-m-d H:i:s’ format.

[bbpnns_date format="Y-m-d H:i:s" /]

Using the shortcode with a different date format. Here, the date will be displayed in the ‘d/m/Y’ format and the time in the ‘H:i’ format.

[bbpnns_date format="d/m/Y H:i" /]

Note: The ‘format’ attribute uses the PHP date format strings. You can find more details about these strings in the PHP documentation.

PHP Function Code

In case you have difficulties debugging what causing issues with [bbpnns_date] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'bbpnns_date', array( $this, '_process_date_tag' ) );

Shortcode PHP function:

function _process_date_tag( $atts, $content='' )
    {
        $atts = shortcode_atts( array(
            'format' => get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) ,
        ), $atts, 'bbpnns_date' );
        
        return date_i18n( $atts['format'] );
    }

Code file location:

bbpress-notify-nospam/bbpress-notify-nospam/includes/controller/common_core.class.php

Conclusion

Now that you’ve learned how to embed the bbPress Notify (No-Spam) Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *