Skip to:
Content
Pages
Categories
Search
Top
Bottom

do_action bbp template notices ?

  • I think i’m starting to understand how to build your own forum themes,

    But i have a question,

    What does <?php do_action( 'bbp_template_notices' ); ?> do for my theme?

    I’m not very good at PHP and i have search but there is none template_notice.php file also i can’t find any filter of function called like this inside a template file, so i was just asking myself what it would do for my theme?

Viewing 5 replies - 1 through 5 (of 5 total)
  • I found something..

    https://codex.wordpress.org/Function_Reference/add_action

    Only trying to find where those functions are.. they aren’t in my functions.php

    ??

    So they call a function by the plugin DO_ACTION PHP code but i can’t find the template that lists all those actions-/functions.


    master5o1
    Participant

    @master5o1

    It allows for plugins to run a function at certain places during the page generation.

    So if someone has a plugin that may generate some notices to the user, then they will add a function to the bbp_template_notices action. This allows them to hook into the action and their function is run each time the do_action(‘bbp_template_notices’); is called in the theme, or rest of WP/bbp.


    master5o1
    Participant

    @master5o1

    Adding an action is add_action(‘bbp_template_notices’, ‘funciton_name’);

    I used this bbp_template_notices action hook to print my post toolbar in earlier versions of the plugin. This is because I noticed that the do_action(‘bbp_template_notices’); was (in bbp-twentyten) near the post form, so each time the post form is displayed, the template notices action is run and the post toolbar is displayed.


    master5o1
    Participant

    @master5o1

    Also, add_action and do_action are in wp-includes/plugin.php.

    Thank you…

    So it’s a hook for WordPress and other plugins to work into this bbPress form..

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar