I've a bunch of techniques to add some information in admin area for users. For that I use WordPress APIs and meta boxes.
Ok it's cool but what if I want to display information that are set with the post e.g I have a metabox, I want to show some preview of the settings inside post edit.
I cannot do this using global $post
and $post->ID
which are pretty handy for get_post_meta()
.
I mean it's pretty a matter of load. At this time e.g in post-new.php
we do not have this information because WP_Post object has not been set up yet.
How do you do this?
EDIT: to be more precise I'm trying to get post meta in admin area. For example I have a code that add a metabox and the user enter or select something. I want to retrieve that in the same area. This way the user can see if its setting is correct or not.
I've nothing against AJAX but I'm one of those that consider nojs first and if possible or if that brings comfort for users js as additional layer.