Forums

Edtor alters Paypal button code on update (4 posts)

  1. sierrarose49
    Member
    Posted 1 year ago #

    I am brand new to WordPress. I was told this was the "latest verstion" but do not know how to tell what version it is.

    I want to add a Paypal donate button to my page (which works in Joomla)

    I tried to insert this code in HTML mode:

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank"> <input name="cmd" value="_s-xclick" type="hidden" /> <input name="hosted_button_id" value="XL2G4JJKL9QM4" type="hidden" /> <input src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" type="image" border="0" /> <img src="https://www.paypal.com/en_US/i/scr/pixel.gif" target="_blank" width="1" border="0" height="1" /> </form>

    When I click "Update" it gets turned into this:

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank"> <img src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" border="0" height="1" /> </form>

    Why does this happen and how can I keep the editor from mucking with my HTML code? If I put in HTML code I want it to stay there!

  2. stvwlf
    Member
    Posted 1 year ago #

    The WordPress editor removes certain tags. Among them are hidden input fields, which is what disappeared in yours.

    I know two ways to get around this.

    The one that will be easiest for you is to get the email link from Paypal (Paypal makes both an HTML version and an email link version of code. Then you replace the text link words in the email link code with the paypal image code
    <input src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" type="image" border="0" />

    The WP editor will not eat that code.

    The other method involves entering the Paypal form code as a custom field and using a plugin that lets you insert the custom field's content into the post at the point you indicate.

    being new to WordPress the first method will most likely be easiest for you.

  3. sierrarose49
    Member
    Posted 1 year ago #

    Is there a way to get the WordPress editor to not eat code? That is what I really want. Then I can do in HTML what I really need to do.

  4. stvwlf
    Member
    Posted 1 year ago #

    I haven't found a way to guarantee WordPress won't eat some code. It is better if you NEVER use the visual editor or go to that tab. But that defeats some of the convenience of using WP.

Topic Closed

This topic has been closed to new replies.

About this Topic