If you move to using BBpress 2, BBpress 2 uses custom post types and is a plugin of WordPress. This would let you do the above query using standard WordPress calls, and WP_Query. You would then automatically inherit all of the caching systems WordPress uses, and support for things like W3 Total Cache DB caching etc
Else, you could use the WordPress Transients API to cache the results:
Related Posts:
- Loading external page template and enqueue script from plugin causes 403 forbidden error
- Where the Nickname is being used in WordPress
- WordPress plugin from own server
- How to avoid plugin name conflicts from the upgrade notifier?
- Show Similar Post Titles ( Similar to Stack Exchange )
- How do I unlock a post programmatically?
- Is their any way to Extend WPDB class and Overwrite the Default Query Function
- Add content to /wp-admin/plugin-install.php admin screens
- How do I only load a plugin js on it’s settings pages?
- Need a function for changing saved post_date or post_date_gmt to relative time in wordpress
- How can I include a setting that has a variable number of values in a settings page using register_setting?
- Activate Plugin which is in subfolder?
- Adding dynamic section to WordPress
- Use functionality of 2 wordpress plugins
- Autoload via composer in plugin interference
- Yoast SEO blocking/re-initialising longer running process
- Add Fields with Sub-Fields to WP Job Manager
- template_redirect not being called when using ajax
- Can WordPress plugins “Talk to each other”?
- How do I store information in a dynamic block in WordPress?
- Is it possible to set up multistore in Woocommerce? [closed]
- Is there a way to alter the order in which the plugins appear in the page?
- How to correctly detect accessing wp-content/uploads?
- How to create custom embed block in gutenberg wordpress
- Plugin exceeds memory limit
- Find the URL of the current plugin directory
- How can sanitize $_FILES[‘haq_slider’] field
- How to trigger $_GET request within admin plugin page?
- Plugin Paths Issue
- How to generate video out of images via WordPress plugin
- WordPress plugin – Error “Plugin generate 2890 characters of unexpected output when activated”
- Woocommerce plugin for minimum order and add-to-card-step
- UnInstallation of a Plugin from a developers perspective – The correct and clean method
- Get plugin option in another PHP file
- Using a post-signup hook to get user details
- How to apply a patch via plugin?
- wp_remote_get() returns 403 while file_get_contents() does not
- How to set add question capability for author role in wp pro quiz plugin
- Unable to delete custom post types, confusion around capabilities
- Getting wp.me shortlink for wordpress custom post type
- where is the main file in this plugin?
- Remove .htaccess portion upon plugin deactivation?
- Insert Array in Plugin Database
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- First plugin, problem with get_pages
- Shortcode Attributes to Return different $_POST
- Plugin onclick button activate other plugin
- Translation issue with global variables
- Is there a better way of handling AJAX requests in WordPress?
- what is the point of telling add_filter how many parameters you want passed to the function?
- How to add category and subcategory in WordPress custom code?
- Structuring function with registration_errors hook
- Can’t create tables with my plugin
- Yoast SEO Plug In and my Theme duplicating code. Need some feedback on what to do? [closed]
- unregister a sidebar widget
- Is it possible/advisable to set last stable version to previous version?
- How to make sure settings are not lost when plugin is updated?
- Could add_query_arg() redirect user to external site?
- How to solve conflict with scripts?
- wp_insert_post not inserting post from XML
- How can replace this url
- Access “wp site health info” data from plugin
- WordPress Frontend Page using Plugin
- How to overwrite a plugin?
- How can I translate something in my class constructor of my plugin in WordPress?
- Define global variable in theme file and call that variable in plugin file
- SimpleXML is not working with xml response from external api
- Custom Plugin Update
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- Change Woo Custom Endpoint Titles from a Plugin
- Custom wp_list_tables redirect on specfic page
- Hook to display element as product on category page
- Missing files in enqueue actions causes WordPress to reload
- I can’t use WP_Query
- Adding/ Removing actions for plugins
- Get input form data posted by users
- WP Plugin: Print javascript in header
- wp_verify_nonce fails always
- Custom Plugin: Point to `template_directory`
- Adding list of Indexes in wordpress document
- API Functions to Register and Show WordPress List Tables
- How to save default values into an option and delete those upon actvation and deactivation in wordpress?
- How to Add Jquery FullCalendar in wp plugin in admin
- WP internationalization not loaded
- Plugin options not appearing on options page using tabbed navigation
- Ajax, jQuery and WordPress
- Adding custom cron_schedule prior to wp_schedule_event
- Create plugin with form in post and submit it to specific form
- Storing values in Post Meta vs new tables
- Add custom fields in the new and edit the site forms without touching the WP core
- Extend WordPress REST API with Scheme Pro Plugin
- How to submit the custom form data in database in WordPress without plugin?
- map urls to plugins
- WordPress check box unchecked on null value ternary operator [plugin development]
- Embed php code in custom field of a plugin [closed]
- Why haven’t I see plugins using get_file_data to handle retrieving plugin version?
- WP Elementor Pro causing crtical failure on website
- Function not being called on form submit, only blank admin-post.php page
- How to give specific class name to category in wordpress with code snippets
- Display Any Field fromAdmin Panel in Frontend via Shortcode?