Support ClassicPress News widget (#65)

Signed-off-by: xxsimoxx <simone@gieffeedizioni.it>
Signed-off-by: Joe Dolson <design@joedolson.com>
Co-authored-by: xxsimoxx <simone@gieffeedizioni.it>
Co-authored-by: Joe Dolson <design@joedolson.com>
This commit is contained in:
Simone Fioravanti 2025-06-12 17:03:40 +02:00 committed by GitHub
parent 8978db5838
commit e96b524535
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,6 +10,10 @@ const EVENTS_API = 'https://api.fair.pm/fair/v1/events';
* Bootstrap.
*/
function bootstrap() {
// Support existing software like ClassicPress, which removes this feature.
if ( ! function_exists( 'wp_print_community_events_markup' ) ) {
return;
}
add_action( 'wp_ajax_get-community-events', __NAMESPACE__ . '\\get_community_events_ajax', 0 );
remove_action( 'wp_ajax_get-community-events', 'wp_ajax_get_community_events', 1 );