From 8c788853ffe05cfca40f1b21bd15af9b9f1ed9aa Mon Sep 17 00:00:00 2001 From: Derrick Koo Date: Mon, 14 Jun 2021 17:12:21 -0600 Subject: [PATCH] fix: activation PHP warning --- includes/class-newspack-listings-taxonomies.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/class-newspack-listings-taxonomies.php b/includes/class-newspack-listings-taxonomies.php index e4cfbbea..163a7f11 100644 --- a/includes/class-newspack-listings-taxonomies.php +++ b/includes/class-newspack-listings-taxonomies.php @@ -53,6 +53,7 @@ public function __construct() { add_action( 'admin_init', [ __CLASS__, 'handle_orphaned_terms' ] ); add_filter( 'rest_prepare_taxonomy', [ __CLASS__, 'hide_taxonomy_sidebar' ], 10, 2 ); add_filter( 'the_content', [ __CLASS__, 'maybe_append_parent_listings' ] ); + register_activation_hook( NEWSPACK_LISTINGS_FILE, [ __CLASS__, 'activation_hook' ] ); } /** @@ -659,6 +660,13 @@ function( $listing_term ) use ( $post_id ) { return $content; } + + /** + * Register taxonomies on plugin activation. + */ + public static function activation_hook() { + self::register_tax(); + } } Newspack_Listings_Taxonomies::instance();