<div>You shouldn't need to use WP_Filesystem for read-only operations, it's an API designed for write access. </div><div>I'll leave it up to every one else for what you should be using, as I'm not aware of the "best practice" for themes. (I would add however, how ever you do it, cache it (transient?), don't scan on every admin options page load..)</div>
<br><div class="gmail_quote">On 27 September 2011 20:44, Syahir Hakim <span dir="ltr"><<a href="mailto:khairulsyahir@gmail.com" target="_blank">khairulsyahir@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Greetings, theme devs!<br>
<br>
I have a question regarding the restriction of file operations in themes. I am well aware that we shouldn't use PHP's built in file operation functions directly in the theme due to security concerns, but what if we just need to read in a content of a file to scan it with a regex? I'm basically using a function to scan the template files in my theme for all added action hooks, so that I can list them in the options page programmatically rather than manually typing out the list. Is there a way to use the filesystem API without requesting credentials? I'm asking this because there'll be no writing operation at all, just reading, and typically template files have no permission restriction on read operation on the server. Also, asking the user to enter FTP credentials every time they access the options page is very inconvenient, bordering annoying, in fact.<br>
<br>
Thanks for any input!<br>
<br>
-- <br>
Regards,<br>
Syahir Hakim<br>
<br>
Contact:<br>
<a href="http://www.khairul-syahir.com" target="_blank">http://www.khairul-syahir.com</a><br>
<a href="tel:%2B6421%200333%20649" value="+64210333649" target="_blank">+6421 0333 649</a><br>
<br>
_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">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>
</blockquote></div><br>