latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Using PHP code – it changes itself

Home Forums Community Forum Using PHP code – it changes itself

This topic contains 4 replies, has 3 voices. Last updated by  cassel 4 years, 4 months ago.

Topic Author Topic
Posted: Thursday Aug 30th, 2012 at 12:24 pm #23598
cassel
Username: cassel

I have had issues editing text in WP forever: spacing, returns and such done in the Visual tab dont translate to the Html, or vice versa. But that is something i can live with (although VERy annoying).

Now, my BIG problem is that if i need to use some php coding for conditional (i need some coding not available in shortcodes), the typing is changing when i switch from HTML to visual and back to HTML. Here is an example:

<input type="hidden" name="invoice" value="” />
becomes

(no idea why ‘name’ and ‘type’ were switched either)

becomes:
<!–?php } ?–>

I have the PHP Execution plugin to allow those PHP codes in the posts/pages but not sure it does what it is supposed to do if the php codes changes like that. This is a horrible behavior when i need to use php code for s2M conditionals. I got a code to create a custom ccaps with the time of a particular transaction. It works. We tested it, but now, to use the php conditional to check on the particular condition, the code does not seem to “stick”.

It happens on my computer and my developper’s computer too. I tried to removed the theme, and it didn’t help. This means that the code might work when first published but if the page is edited at any moment, it wont work anymore.

HELP!

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Friday Aug 31st, 2012 at 4:52 am #23653
Raam Dev
Username: Raam
Staff Member

This is a problem with the WordPress Visual Editor. It happens with everyone who uses a plugin that allows inserting PHP code in WordPress posts/pages.

If you’re going to be inserting PHP code, you must never use the Visual Editor. That’s really the only solution: Never use the Visual Editor. (You can disable the Visual Editor on your account by editing your WordPress profile and disabling it.)

Posted: Friday Aug 31st, 2012 at 6:39 am #23675
cassel
Username: cassel

Yikes! Considering that i am just about allergic to html and cannot code anything on my own, this is a tall order! Well, at least i know there IS a solution and i am not hallucinating!
Thanks anyways.

Posted: Saturday Sep 1st, 2012 at 7:16 am #23766

The only way to use the visual editor when you want to use PHP code in the post, is to do all the visual part first and then switch to the HTML editor to paste the PHP code, and never go back to the visual one or it’ll mess up your code.

Posted: Saturday Sep 1st, 2012 at 9:11 am #23785
cassel
Username: cassel

I can live with that, since i know why that was happening.
Maybe someone can fix that in WP and make lots of users happy!

Viewing 4 replies - 1 through 4 (of 4 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.