helpers->getPublicTaxonomies(); foreach ( $taxonomies as $taxonomy ) { add_action( $taxonomy['name'] . '_edit_form', [ $this, 'addTaxonomyUpsell' ] ); add_action( $taxonomy['name'] . '_add_form', [ $this, 'addTaxonomyUpsell' ] ); } } } /** * Add Taxonomy Upsell * * @since 4.0.0 * * @return void */ public function addTaxonomyUpsell() { $allowedScreens = [ 'edit-category', 'edit-post_tag', 'edit-product_cat', 'edit-product_tag', ]; $screen = get_current_screen(); if ( ! in_array( $screen->id, $allowedScreens, true ) ) { return; } // phpcs:disable Generic.Files.LineLength.MaxExceeded echo '