Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hooks & Filters Docu

  • Rather than just keeping private notes on the hooks and filters I found, I thought it best to maybe start a list here with everyone, just as a rough working documentation of the hooks and filters.

    For future ref/for people that don’t know, a hook is a means of bbPress making your plugin run every time a certain thing happens. To get that to work, put this code at the very bottom of your plugin:

    add_action( 'hook_name', 'functionname' );

    Filters are very similar to hooks, only it gives your plugin some data, you can then do something with the data (filter it), and then pass it back. To register for filters, put this code at the bottom of your application; remember to accept the parameters in your function and return them as appropriate.

    add_filter( 'filter_name', 'functionname' );

    Note that in both cases you want the name as a string and the function’s name as a string, no brackets or parameters at the end of it! An optional third parameter is the priority of your function; default is 10, so set this higher if you want it to execute last or lower if you want it to execute earlier.

    Some Filters

    topic_title – this passes the topic title to your function when the threads are being listed, like on the (default) front page.

    bb_allowed_tags – this is the array of HTML tags you can use in your posts. Hang a filter on this and add elements to the array if you want to allow more tags.

    Some Hooks

    bb_head – this is called when the HTML <head> element is being filled, so you can add stylesheets or javascript and the like.

    bb_user_logout obviously gets called when someone logs out.

    bb_init when someone logs in?

    bb_new_user when someone registers; passes the ID along I think

    bb_profile_menu – haven’t figured out how it works; I think it’s to do with the tabs at the top of the profile.

    If you know any more hooks or filters, or find ’em, please post them here with a quick description if necessary!

Viewing 25 replies - 1 through 25 (of 37 total)
  • Nice we also need a list of available APIs :)

    I would like that as well Null! I changed the title to be more clear! Hope you don’t mind!

    Trent

    It’s not actually meant to be instructions, more like a list of hooks and filters Trent. I just included that as an aside for someone starting out.

    I’m sure you two have seen some more filters or hooks yourself, so help out and add them please. The point is, rather than waiting around for documentation, start getting some makeshift documentation up ourselves.

    post_text is a filter called on the text leaving the database I think, it’s what the emoticons use.

    Although this topic is a noble idea, I can’t see it having enough structure to be really useful.

    I’ve started a conversation about creating a wiki for this sort of thing on the dev list. I think that would be optimal and more easily maintained.

    I’d be happy to start one, but I think it would be better coming directly out of Automattic.

    Fair enough ;)

    Trent

    @Sam – We talked about this documentation on the bbdevlist before and Matt wanted to lean towards the release of a major release of bbPress before any real start to avoid massive changes to the documentation, so here we sit *sigh*

    Trent

    Walks by and sees Trent sitting…. Heya Trent, want some company?

    So you guys wanna keep sitting or anyone fancy not waiting around for however long?

    It’s out of our hands, come sit with us, silent demonstration :D

    It’s not really out of our hands. We could do something.

    Yes, we could set up a wiki – but to avoid (most of) the stated problem it would have to be a technical/developers wiki for now. We should also agree to move it’s contents to any official wiki when it comes along. I assume that an official wiki would use the same software as codex.wordpress.org which appears to be mediawiki, so to be compatible when the time comes we would have to use that too. My personal thought is that it is about time for this, and as the development community grows it is becoming necessary. I could set one up in half an hour (I’d be happy to host it – ad free). And we could work out the taxonomy of it here.

    To be slightly democratic, I say if ten people who we recognise as regulars/developers vote for it here, then we should go ahead. I’m also willing to hear arguments against the idea too.

    Should we vote on it?

    Set it up sam!

    For now we need some stuff about:

    Installation

    WP intergrating

    API’s

    Hooks

    Filters

    Plugins

    Templates/themes

    Did I forget something?

    I don’t know if recognised or not, but I’m all for it.


    LMD
    Participant

    @louisedade

    I don’t know if I count as recognised or regular? Does it help if I remove my disguise?

    I’m all for some docs, even if it’s just a bare-bones list of available hooks and filters.

    @Null: perhaps not installation and WP integrating as I don’t want to duplicate existing docs on this site and I think we should stick to developer docs for now – primarily to help plugin developers. The others seem like sound start to the categories though.

    Well lets start a wii thingy now with a list of:

    API’s

    Hooks

    Filters

    And with what they do/can be used for…?

    Anyone got a good domain name suggestion? I’ve got a domain name registration credit at my host which I can use.

    bbwiki.com is taken, but http://www.bbreference.com is not. If it’s understandable it doesn’t matter that much anyway. :)

    bbdocs.com?

    I still think that codex.bbpress.org is still the best though to avoid confusion and keep the same design. Someone send something in the developer list again for some ‘more pointed’ discussion on this.

    Trent


    chrishajer
    Participant

    @chrishajer

    Ditto on the subdomain of bbpress.org.

    Didn’t you say there will be no Automattic documentation before 1.0 release? Obviously codex.bbpress.org is the best, but that would be official … and we haven’t got official.

    We should assume that codex.bbpress.org is out of the question for now, even though the content that we generate may end up there.

    How about bbpulp.org ?

    quote: How about bbpulp.org ?

    I love it :D

    > I love it :D

    So do I, so here it is http://bbpulp.org

    Registration required to contribute.

    All articles to be submitted under the GPL Free Documentation License.

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