• I am uploading to a custom post type: article and if published has the permalink
    /article/example-uploaded-here

    Now if someone else submits a form with the same title “example uploaded here” the draft post has the same permalink in the database and the unintended consequence is whatever someone else posted is public. Only if the second post is published then wordpress resolves the ambiguity new post gets the permalink /article/example-uploaded-here-1

    PS I use the hook add_action('cf7_2_post_form_submitted_to_article', 'new_post_mapped',10,4);
    and the function ends
    ` $current_user = wp_get_current_user();
    $author_id = $current_user->ID;
    $arg = array(
    ‘ID’ => $post_id,
    ‘post_author’ => $author_id,
    ‘post_content’ => $newcontent,
    );
    wp_update_post( $arg );’

    where newcontent is processed upload content

    • This topic was modified 2 years, 4 months ago by antonv.
  • The topic ‘Permalink problem’ is closed to new replies.