Forums

post_id and add_post_meta in post-new.php (1 post)

  1. romain_becket
    Member
    Posted 3 years ago #

    Good evening,
    I want to add a meta value to a post when a editor, contributor, or admin enter in the 'write a new post' page.

    I try to add this line in wp-admin/post-new.php
    'add_post_meta($post_id,'Destiscrib',$autoscrib);'
    but the issue is that $post_id==0 because the post isn't yet

    I try
    'add_action('publish_post', 'ajouter_destiscrib');'
    but add_action seems don't work here.

    I try do add :
    do_action(...) and put action in a other file but how can I retrieve $autoscrib
    (and I think it's a complicated way for a little modification)

    I need help, please.

    Romain.

Topic Closed

This topic has been closed to new replies.

About this Topic