Add custom "category filter" for Flex Block 1 – pull from wp_postmeta

Posted in: Newspaper
Post count: 17

My site allows random users to submit content, which is stored in the wp_posts and wp_postmeta tables. We’re not creating WordPress accounts for these readers, so we store the name they give us as pen_name in the postmeta table. On a post page we’re retrieving the pen_name from the postmeta table and linking it to the authors page (a cloud template). This cloud template uses the Flex Block 1 module to display posts.

While looking at this block I see that there are options under Filter > Category Filter, we’re using the Author - Current Author option. I’m looking through the theme code and I see that option comes from here:
/wp-content/plugins/td-composer/legacy/common/wp_booster/td_util.php (lines 2155 - 2187

and is implemented here:
/wp-content/plugins/td-composer/legacy/common/wp_booster/td_block.php (lines 191-208)

What I’d like to find out is if there’s a way for me to inject a new option into that list, one that I would write myself. I’ve already written two new blocks, so I’m a little familiar with your API. I just don’t know if this is possible.

Post count: 18283

Hello!

This can be done, but unfortunately it is not covered by the support team. But yes, this can be done.

Thank you!

Post count: 17

Vlad, thanks. I’m happy to do it myself, do you have a link to documentation which might help me work through it on my own?

Post count: 21065

Hello!

Unfortunately, we do not have a documentation how you can achieve this step by step, but you can take a look here: https://forum.tagdiv.com/practical-example-how-to-add-a-new-block-and-module/

Hope that helps you somehow!

Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.