The question is slightly vague, so forgive a slightly vague answer…. but the way I would do this is by AJAX request.
- Click button – add event to listen for the request this would be frontend with Javascript / jQuery and would probably have a
post_id
to request attached to it. - Load data – you could do this via the WordPress REST API or add your own endpoint function to return what you need via the established
admin-ajax.php
(you would be looking for the section titled “Ajax on the Viewer-Facing Side” and look into thewp_ajax_(action)
hooks) - Parse your data – load into your pop-up the data returned, making sure to add error handling to explain any issues / connection problems or unexpected data.
If I’m talking nonsense above, then you will need a plugin or some cash to pay someone who knows what they’re doing. It’s not a massive job though if you have a clear design of what you want and clear functionality steps spec’d out.