This definitely sounds like plugin territory; there is no reason the Theme author could not write into their documentation a recommended plugin to enhance the Theme's functionality (provided the plugin is not "required" for the Theme to work correctly).<br>
<br><br>Cais.<br><br><div class="gmail_quote">On Thu, Apr 28, 2011 at 1:56 PM, Otto <span dir="ltr"><<a href="mailto:otto@ottodestruct.com">otto@ottodestruct.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I'd seriously recommend against allowing users to input PHP code into<br>
a theme's form field for execution... allowing them to paste in custom<br>
HTML should be more than enough.<br>
<br>
But... if I was going to do something like this, I'd use<br>
create_function instead of eval.<br>
<br>
add_action( $action_hook, create_function( '' , '?>'. $php_code ) );<br>
<br>
That said, I would be highly reluctant to do or allow this sort of<br>
thing in a theme. There's entirely too much potential for users to put<br>
in bad PHP code, break their site, then not understand why. The PHP<br>
Code Widget I created years ago when widgets were new is probably my<br>
most popular plugin, and I still get emails with people telling me<br>
it's broken when it's really just their own bad copy-pasted code.<br>
<br>
This sort of thing is better off put into a plugin, so that it can be<br>
disabled at will.<br>
<font color="#888888"><br>
-Otto<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
On Thu, Apr 28, 2011 at 6:58 AM, Rahul Bansal <<a href="mailto:rahul.bansal@rtcamp.com">rahul.bansal@rtcamp.com</a>> wrote:<br>
> Hi All,<br>
> In next theme, we are preparing for open-source release, we want to provide<br>
> a "hooks-editor" interface.<br>
> Like many pro themes, we have added a lot of custom action & filter hooks in<br>
> our theme code base.<br>
> In admin area, we plan to provide list of hooks, each coupled with a<br>
> textarea, which can be used to post php-html codes in them (like<br>
> action-handlers)<br>
> Now, to "execute" action handlers in textarea, we need to use eval()<br>
> function in PHP which is prohibited here.<br>
> So what are my alternatives here?<br>
> Just a note - we do not want to provide custom.css and/or<br>
> custom-functions.php files (like thesis provides) as they are hard to<br>
> maintain in multisite environment.<br>
> Also child-theme support is not yet present on repo so creating child themes<br>
> with style.css & function.php (to declare action handlers) is not feasible<br>
> either at this stage.<br>
> Please suggest something.<br>
> Thanks,<br>
> -Rahul<br>
> --<br>
> Rahul Bansal | Founder & CEO | rtCamp Solutions Pvt. Ltd.<br>
> Skype: rahul286 | Twitter: @rahul286 | Web: <a href="http://rtcamp.com/" target="_blank">http://rtcamp.com/</a><br>
><br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> theme-reviewers mailing list<br>
> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
><br>
><br>
_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
</div></div></blockquote></div><br>