Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Add custom metadata to forum topics for sorting purposes

@menelik-seth

Member

Thanks for the tip! I’m going to have to figure out how to validate the form input to ensure that it’s an array (and that the check-boxes have been selected). That’s next on my to-do list after I’ve set up some custom loops to display posts based on the metadata I’ve created :D (will post the code when I’m done, so all can critique, and benefit)

Yes, I have tried r-a-y’s suggestion, and it worked like a charm (Thanks again r-a-y!) However, using bb_update_postmeta() wouldn’t allow me to assign an object_type, as far as I could tell, by passing it as an argument. I’m not even sure if a custom object_type is necessary, but I figured it couldn’t hurt, and could prove useful later on… I’d love to tinker more with this function, but I have deadlines to meet so I’ll push on ahead and review this later, once I’ve got more time. For now, it gets the job done :D

EDIT: Function, r-a-y style!

`function cg_newmeta( $id, $postcat) {

do_action (‘bbpress_init’);
bb_update_postmeta($id, ‘cg_catagory’, $postcat);
}`

Skip to toolbar