WordPress.org

Ready to get started?Download WordPress

Forums

Changing comment form? Please help. (8 posts)

  1. takmig
    Member
    Posted 5 years ago #

    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!

  2. takmig
    Member
    Posted 5 years ago #

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

    Anyone?

  3. takmig
    Member
    Posted 5 years ago #

    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?

  4. takmig
    Member
    Posted 5 years ago #

    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)! :)

  5. takmig
    Member
    Posted 5 years ago #

    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.

  6. takmig
    Member
    Posted 5 years ago #

    This forum is a joke.

  7. Drawer
    Member
    Posted 4 years ago #

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

  8. nasirhuq
    Member
    Posted 4 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic