Hi,
is there any plugin, that allows me, to run regular php code in Articles/Pages?
I found a lot of plugins, but it seems, that all of them work only in a regular wp installation, but not in wpmu..
Lars
Hi,
is there any plugin, that allows me, to run regular php code in Articles/Pages?
I found a lot of plugins, but it seems, that all of them work only in a regular wp installation, but not in wpmu..
Lars
Exactly what are you looking to do?
It is quite easy to allow the embedding of controlled chunks of PHP code inside a post
Hi,
for example: <?php echo 'test'; ?>
I already changed some options: I switched off the the wysig editor and disabled the option to correct xhtml.
When i insert php code, it dissappears after updating the page.
So what do i have to do, to allow a regula php code?
I want to be able to insert everything i want in php. Is that possible?
Lars
You can't by default just execute php code like that inside your web page.
It would be too easy for a user to embed malicious code in there, like:
mysql_query("truncate wp_site");
Okay. All users are trustable. In my case Wpmu is used as a cms. What can i do, to change this?
"but it seems, that all of them work only in a regular wp installation, but not in wpmu.."
Did you try them in MU?
Yes,
maybe i made i mistake. Do you know onw, that could work?
http://wordpress.org/extend/plugins/exec-php/
Haven't tried in myself on wpmu but others have I believe. I'm sure a search of the forums will pull up previous discussion on the topic.
I tried it and does not work.
What exactly does not work?
I've been attempting to use exec-php in WPMU as well, to no avail.
Despite setting everything up per the exec-php manual, when I post code into a Page or Post, WPMU simply eats the code and it disappears on save.
I've verified that the user account I am using has the visual editor disabled and has the unfiltered_html capability. Still no joy.
Any help would be appreciated.
Ok, to answer my own question, I found the solution:
Open your wp-includes/kses.php file. Go to line 1086 and comment it out. The line looks like:
add_filter('content_save_pre', 'wp_filter_post_kses');
This disables WPMU from removing code content from a page or post.
Be aware of security issues, though.
The "unfiltered html" plugin does the same thing, without a hack. :)
*insert terrible security warning here*
Thanks for the answers. INow i use unfilterde html and exec php an it works fine.
I encountered the same situation with WPMU 2.9.1.1, and your solution perfectly worked! Thanks!
Open your wp-includes/kses.php file. Go to line 1086 and comment it out. The line looks like:
add_filter('content_save_pre', 'wp_filter_post_kses');
For MU users, there is a version of the "unfiltered html" plugin called unfiltered MU.