$post_id or $post->ID in wordpress meta box construction
Can someone explain why when creating meta boxes the callback needs the post id to be passed via $post->ID, however with the action hook 'save_post', the function can pass $post_id. A general explanation of when to use which one would help clear up some issues I've been having, thanks. ex: function show_custom_meta_box($post) { $meta = get_post_meta($post->ID, 'custom_meta_class', true); // Use nonce for verification echo '<input type="hidden" name="custom_meta_box_nonce" value="'.wp_create_nonce(basename(__FILE__)).'" />'; // Begin the field table and loop echo '<table class="form-table">'; e
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.