Support » Plugins » Creating a post when it does not exist

  • wesleyb77425

    (@wesleyb77425)


    Hi chaps,

    I have setup wordpress to retrieve posts using the %post_name% PERMLINK, I would now like to create a plugin that will create a post when it does not exist. For example,

    – user requests http://domain.com/does-not-exist
    – on the back end, I create an empty post titled ‘does-not-exist’ which is then returned to the user.

    I’m pretty new to wordpress, and although I understand how actions/filters work, I can’t see an elegant solution to this.

    If you have any ideas how I could do this quickly and efficiently, please share.

    wes

Viewing 7 replies - 1 through 7 (of 7 total)
  • Doodlebee

    (@doodlebee)

    I’m sorry – but what would be the purpose of this? What you’re describing would mean that post would be created any time someone tried to visit a non-existent URL on your site. It doesn’t make any sense. Why would you want to do that?

    Thread Starter wesleyb77425

    (@wesleyb77425)

    Yes, that’s exactly what I am describing, any pointers to help me out?

    vachi

    (@vachi)

    its a pretty cool idea, idk how you can do this but i suggest trying to save the link that the user requested that did not exist, so save the 404s
    and when they request a page thats a 404 just say we are creating this page at the moment ( in your 404 template ) than you can see the 404s and just make those pages

    Doodlebee

    (@doodlebee)

    I’m still not sure what the purpose is – nor if it’s even possible. You have to be logged in (and have the capability level) to create a post. What you’re suggesting is that *anyone* could come along and create a post, just by typing in some random URL that starts with your domain name. The possibilities of exploitation are mid-boggling.

    Maybe if you explained *why* you want this done, an alternative (and possibly better) solution could be offered.

    Thread Starter wesleyb77425

    (@wesleyb77425)

    A pity, I was hoping to avoid switching on legacy hacks.

    Doodlebee

    (@doodlebee)

    So, you don’t want to share what the purpose is for, in hopes of a better suggestion? Well, good luck with that then.

    selfmade64856

    (@selfmade64856)

    – wesleyb77425 –
    Fantastic idea! I see exactly where you’re going with that. If you find the solution let me know and I’ll do the same 😉

    Ciao

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Creating a post when it does not exist’ is closed to new replies.