bbPress

Simple, Fast, Elegant

bbPress support forums » Requests and Feedback

How to read bb_topicmeta?

(5 posts)
  • Started 2 years ago by ear1grey
  • Latest reply from mdawaffe
  1. I'm writing a plugin and looking for a way to read the bb_topicmeta table without resorting to cranking out SQL. I can find the bb_update_meta method but no matching bb_get_meta.

    Is there an obvious other metadata retrieval method or is this one for trac?

    Posted 2 years ago #
  2. Unlike WP, topic meta is accessed throught the topic object.

    update_topicmeta( 5, 'my_meta', 'yay' );

    $topic = get_topic( 5 );
    echo $topic->my_meta; // outputs: yay

    Posted 2 years ago #
  3. nolageek
    Member

    Unlike WP, topic meta is accessed throught the topic object.
    update_topicmeta( 5, 'my_meta', 'yay' );
    $topic = get_topic( 5 );
    echo $topic->my_meta; // outputs: yay

    Um. What? I see this isn't going to be a fun forum system to customise if you're not a PHP programmer. I have NO IDEA what the above means. (I dont mean that as a slam, just a declaration that I'm in over my head at this point.)

    Posted 2 years ago #
  4. Thx Mike; perfick.

    @nola: the short version is that if you already have the topic (which I do because I'm using this in the topic.php template), then instread of saying: echo bb_get_topicmeta($topic->ID, "mykey"); whichis what I was expecting, there is the somewhat easier echo $topic->my_key;

    Posted 2 years ago #
  5. nolageek, That information will mostly be useful to plugin authors. You probably won't need to know that in order to customize your site.

    I hope not, anyway :)

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.