Support » Fixing WordPress » Passing category into insert post form

  • There might be a plug-in for this, but I didn’t find one.
    Is there a way to pre-check the category for a post insert? I see that you can include the post_type to the post-new.php code.
    I used categories to identify several different page items and want to make it as easy as possible for users to insert a post without having to remember which page they are posting for.
    I’m still feeling my way around what are the “better” ways to do things in WordPress.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You’d have to use some jQuery for that.

    Force them to a URL like this:


    And then take the cat from the URL and select the appropriate cat.

    Not a great solution, but all I can think of at the moment as I don’t think there’s any native way of doing it.

    I finally found one link (albeit old) that has something that perhaps I could use, but I’m struggling how to make it work as a plugin (which the link suggests).

    There is a link to the (apparently) untested code, but it makes sense. First programatically create a new post of the desired category and then redirect to the edit&post action of post.php for the new past id to allow the user to actually fill in the details and publish it.

    After reading a bunch about creating a plugin (basically one function) I’m not sure how to make it work. I’m learning with this exercise but too slowly.

    Oh, and the person with the suggestion in that thread link was a “Mike Brown”. He includes a link to his suggested source code for the function.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Passing category into insert post form’ is closed to new replies.