I am currently creating a wordpress plugin that retrieves the value of the custom fields after insertion into the database.
I use p2theme and I add a text box (for the value of the custom fields) on the form in frontend.
post is added and the value of custom fields as well in postmeta.
But the problem is that in my plugins there's no value.
function recupere($post_id) {
echo 'POST = ' . $post_id . ' / ';
if (wp_is_post_revision($post_id)) {
return;
}
$post = get_post($post_id);
$meta_values = get_post_meta($post_id, 'destinataire', true);
echo 'meta = ' . $meta_values . ' <br />';
}
add_action('save_post', 'recupere');
Aucun commentaire:
Enregistrer un commentaire