• Hi everybody.

    New to all the plugin development, and quickly ran into a problem. I’ve read on forums and the WordPress sections, but haven’t been able to find a solution yet, so thought you experts in here might be able to help. 🙂

    I am writing a plugin with a very simple function, but for it to work I need to change the WP blog’s comment form <form action="wp-comments-post.php"> attribute so it says: <form action="anotherlink"> instead of the standard “wp-comments-post.php”.
    How do I do this? I would really like to avoid using Javascript, so the “find-form’s-id-and-change-using-javascript” will not do for me. Any way to do this entirely back-end based in PHP with my plugin?

    Thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter takmig

    (@takmig)

    Please, it can’t be that difficult to do? 😉 Except for me of course. 😛
    It’s just how to make my plugin change an attribute in the comment form without using Javascript.

    Anyone?

    Thread Starter takmig

    (@takmig)

    He, talking to myself, but I hope someone can benefit from my posts or help me out, which would be much appreciated.

    As mentioned, I want my plugin to change the action attribute in the comment form without using Javascript. Found this article: http://www.devlounge.net/articles/wordpress-plugin-filters

    Can I just do like this:

    function addContent($content = '') {
      $content = str_replace('action="formerurl", "action="newurl", $content);
      return $content;
    }

    Or? Doesn’t the $content include the comment form as well?

    Thread Starter takmig

    (@takmig)

    I am sure there are a lot of great WordPress plugin developers in this forum who can help me out. Is my problem really so difficult to solve that no one replies?

    All I need is a push in the right direction, and some of you great guys on this forum must have a better idea than me, of how I can come around this issue.

    I’d really appreciate some light on my path. Thanks in advance (again)! 🙂

    Thread Starter takmig

    (@takmig)

    It can’t be true that nobody on this forum can say anything to this. It shouldn’t be so difficult for people who understand the WordPress platform, to help me out.

    If you can’t give me a hint to lead me in the right direction, then at least tell me if my above suggestion would be possible. Will I ruin anything in the WordPress setup or so by trying to change the action attribute? And will the function “addContent()” mentioned above work? It’s either “yes” or “no”.

    Thanks.

    Thread Starter takmig

    (@takmig)

    This forum is a joke.

    Yes, sometimes it is. Quite frustrating. Seems to be hit or miss whether someone will help or answer…

    I have posted in some blogs for my own WP post but some day I can not post any one can any body give me some solution?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Changing comment form? Please help.’ is closed to new replies.