BP Docs doesn’t provide any shortcodes. Internally, it uses template tags, which assume that you’re working in PHP.
You could write your own short codes plugin that show some recent docs or whatever, though.
P
(@poripa)
Actually, that’s what I’d like to do, to show the most recent docs as a sidebar widget.
Could you point me to a resource where I could find out more about writing my own shortcode plugin to create just that?
Writing a widget is pretty straightforward. I’d recommend copying one of the core WP widgets to a new plugin and renaming it, then going from there. I’d use this as a starting point:
https://core.trac.ww.wp.xz.cn/browser/tags/4.4/src/wp-includes/widgets/class-wp-widget-recent-posts.php
I’m actually surprised we’ve never added a “recent docs” widget and would happy to do it. If you end up writing something, please let us know at https://github.com/boonebgorges/buddypress-docs
If not, I’ll probably write one for the next major release–it’s a good idea.
Thanks!
Hi Poripa-
I’ve written up a widget that shows recent docs, but otherwise looks and behaves just like the native WP recent posts widget. You can see the code here:
https://github.com/dcavins/buddypress-docs/commit/5491d30e84a35ebc8e291a5bb30e6b4d89b7bd23
I think we’ll include it in a future release, but you could add the code to your own plugin to have that functionality now, if you wish. The file that matters is class-wp-widget-recent-docs.php.
Poripa-
The new “recent docs” widget will be included in the next BP Docs release.
Cheers,
-David
P
(@poripa)
@david Cavins,
Thank you for the code and the update! I’ve started using it and so far there has been no problem!
BP Docs 1.9, released las night, includes the new recent docs widget. Depending on how your recent docs widget class is named, there may be a conflict when you upgrade. You can either use the new widget or rename the class of the one you’re currently using.
Best,
-David