Support » Fixing WordPress » Force a post to “create” itself when clicking Add New?

  • Resolved f00bar


    Hey everyone, just a quick one (and hopefully easy…)

    I wondered if it was possible to “force” a post to enter into draft mode when you click Add New. I have put in a little jQuery code in the admin head which automatically populates the title with a default text but as far as I can gather, the post only enters draft mode when you tab out of the title area into the main text box.

    You may be asking why I want this to happen. Well, my client has asked for a bespoke custom meta box with image upload. However, if he was to upload the image first without actually typing anything (therefore not technically creating the post) the Save button next to the image uploader will not work, as it performs the same action as Publish.

    So, what I’m asking is if it’s possible to actually create the post as soon as Add New is clicked, rather than it waiting until content is entered…

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Any accidental click on ‘Add New’ would then create a new post. I can see potential for a lot of spurious posts. But… your jQuery already populates the title. Have the same script reset focus onto the post body after it sets the title and see what happens. I’ve never tried anything like this so I’m guessing but that is the first thing I’d try.

    Thanks for the response.

    After some testing, I programmed this:

    $("#title").keyup( function(){

    On entering the add new post page. This would hide all extra boxes until the user put some content into the title box. If the user deleted the title after, the boxes would disappear again 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Force a post to “create” itself when clicking Add New?’ is closed to new replies.