My understanding is he would be recognized as an American League All-Star, but ineligible to play in the game. A somewhat similar situation happened with Jeff Samardzija a few years ago I believe. Well, I guess Ken Rosenthal’s The Athletic article has a different take on this question. From Rosenthal... Baseball will have decisions to make if Baltimore Orioles shortstop Manny Machado and/or Tampa Bay Rays catcher Wilson Ramos get traded to a National League club after their respective elections to the AL All-star team. The situation is not the same as it was in 2014, when Jeff Samardzija wore an NL jersey and generic cap in introductions after the Cubs sent him to the A’s earlier in July. The game is again a pure exhibition, no longer determining home-field advantage for the World Series. Baseball has no hard rule on what it would do with a player who is traded to the other league, but MLB probably would want Machado, in particular, to play in the game, perhaps as an injury replacement on the NL side. How the Orioles would be represented under such circumstances is another question.