Add Event Sources Logic (ActivityPub follows) #86

Open
linos wants to merge 95 commits from event_sources into main
Showing only changes of commit 460b223920 - Show all commits

View file

@ -86,6 +86,10 @@ class Health_Check {
* @return bool True if the check passed.
*/
public static function test_if_event_transformer_is_used( $event_plugin ) {
if ( ! Setup::get_instance()->is_activitypub_plugin_active() ) {
return false;
}
// Get a (random) event post.
$event_posts = self::get_most_recent_event_posts( $event_plugin->get_post_type(), 1 );
@ -113,6 +117,10 @@ class Health_Check {
* @return WP_Post[]|false Array of event posts, or false if none are found.
*/
public static function get_most_recent_event_posts( $event_post_type = null, $number_of_posts = 5 ) {
if ( ! Setup::get_instance()->is_activitypub_plugin_active() ) {
return false;
}
if ( ! $event_post_type ) {
$active_event_plugins = Setup::get_instance()->get_active_event_plugins();
$active_event_plugin = reset( $active_event_plugins );