Support » Developing with WordPress » How to redirect to a page with $_GET parameters

  • I’m trying to redirect to a page with a post edit form, using the post ID as part of the $_GET parameters. I want users to be able to edit published blog posts using an edit form, but I can only setup the form with one of the posts already filled in. I was hoping to allow them to select different posts and edit them through the form.

Viewing 1 replies (of 1 total)
  • Hi @sdcta4

    You fetch posts for the current user like this https://wordpress.stackexchange.com/a/23830 and show them as options in a <select> dropdown.

    Inside the loop:

    <select>
    <option value="<?php the_ID() ?>">
    <?php the_title() ?>
    </option>
    </select>

    Mind the proper opening and closing of php tags.

    This dropdown should be inside of a form, with action parameter as blank so that it submits to itself, where you pick this ID and fetch details to populate fields in your main form.

Viewing 1 replies (of 1 total)
  • The topic ‘How to redirect to a page with $_GET parameters’ is closed to new replies.