Closed lordmatt closed 3 months ago
Hi @lordmatt! Our documentation has been focused in on the template tools and external API, but almost all of our functions are accessible from outside of the project and we have built a system for adding modules to PressForward to extend its functionality.
We have an example module at https://github.com/PressForward/PF_Zenodo.
You would probably want to hook to PressForward's initiating functions in much the same way those plugins do, but it doesn't sound like they have the type of functionality you want otherwise. Our internal functions are able to be used, but unfortunately they are not as well documented as our template functions. If you'd like to use this ticket I can answer your questions for anything you want to build and we can use this as a way to start documenting the internal API a bit better for both you and anyone else who wants to get involved.
I'm building a distributed community and feed discovery tool. It would be ideal if it could add discovered feeds to a folder in PressForward. Not to mention offer the user the choice to remove one if the connection the feed is associated with is removed by the user.
We have internal tools for subscribing to feeds:
$feed_id = pressforward( 'schema.feeds' )->create( $feed_url, $args );
where the structure of the optional $args
flags is described at: https://github.com/PressForward/pressforward/blob/f0d47317a55ae3da08846b82e8d6b32e0e620b80/Core/Schema/Feeds.php#L930
You can query for values for feed_folders
using pressforward( 'schema.folders' )->get_feed_folders()
, or by querying directly using WP's get_terms()
.
We don't have internal methods for unsubscribing/deleting feeds, but you can use WP's wp_delete_post()
to delete the corresponding item with post_type
'pf_feed'
.
If you have specific requests for internal tools that would help with your work, please feel free to suggest them.
This plugin does 90% of what I had been planning to write myself. My new plan is to write a much smaller plugin and simply have it feed feeds to pressforward. I've not been able to find any API docs. Does an internal API exist that would allow my plugin to do this? If so is it documented anywhere? If not, how hard would it be to create one?