Get Post Meta from ID in functions.php

get_post_meta( $appointment_id, ‘_appointment_guest_name’, TRUE ); please make sure that $appointment_id will be the post id and meta_key name should be proper with that id you can check this in wp_postmeta table(check meta_key name is _appointment_guest_name or appointment_guest_name)

MetaBox body is not showing (the callback function)

That global_box_meta_box_callback() is a class method (i.e. a function inside a class) and not a globally defined function, so you need to use [ $this, ‘global_box_meta_box_callback’ ] (or array( $this, ‘global_box_meta_box_callback’ )) when supplying the class method to add_meta_box(): class Foo { … function wpd_add_meta_box() { $screens = get_post_types(); foreach ( $screens as $screen ) … Read more