[Plugin: Allow PHP in posts] WP auto-formatting and PHP
-
Greetings WordPress hackers and gurus!
I am writing some custom PHP scripts for a client who would like it displayed on a WordPress page. On their WordPress installation, I’ve installed the plugin Allow PHP in posts.
The PHP script in question does what most code does: queries a table from a database, plays with the result and prints it in a orderly fashion. It also uses some JavaScript as to access the Google Maps API and display a map.
WordPress’ auto formatting often adds unnecessary paragraph (p) and line break (br) tags to the text. While this isn’t very problematic to regular text that needs to be read, it is causing syntactical errors in the JavaScript portion. (I have the JavaScript being ‘displayed’ by a PHP echo to minimize the amount of times its executed, and to ensure the correct variables are always called.)
I have already disabled WordPress’ auto formatting in the theme’s functions.php file, I have include()’d WordPress’ API in the script and disabled the auto formatting there too, as well as tried a few anti-autoformatting plugins (often requiring the use of a custom field) but have not gotten the predicted results.
The code is being executed by the Allow PHP in posts (using eval() ) but the raw code does not exist in the post, but rather is being include()’d in the post.
Does anyone have any suggestions as to disable WP from auto formatting that text?
- The topic ‘[Plugin: Allow PHP in posts] WP auto-formatting and PHP’ is closed to new replies.