This is a simple plugin that extends the wp-discourse plugin by adding shortcodes for creating links from WordPress to your Discourse forum.
It adds shortcodes for [discourse_link]
, for creating a login link to a specific endpoint on your forum, [discourse_topic]
for beginning a pre-filled topic, and [discourse_message]
for beginning a private message. See the plugin's readme for more details. This plugin is only lightly tested, so let me know if you run into problems with it.
https://github.com/scossar/wp-discourse-shortcodes
edit:
I've added a [discourse_latest]
shortcode. At this point it takes one parameter, max_topics
. The topics are cached for 10 minutes. I'm still playing around with the formatting.
The [discourse_groups]
shortcode retrieves and displays all groups that are not automatic
and are visible
. It adds a 'Request to join' link at the bottom of each group that creates a private message to the group's owners. If no owner exists, the request is sent to a site admin. Results are cached for 1 hour, that can be made to be configurable. I'll add an option to not display the 'Request to join' link for specific groups. The plugin's error handling needs to be improved. There are no styles associated with the plugin. It's up to the site's theme to supply them.
The group description is created by creating a topic on Discourse with a title that follows the format 'About the {group name} group'.