[theme-reviewers] Using file_get_contents() to import theme settings

Emil Uzelac emil at themeid.com
Mon May 23 21:48:13 UTC 2011


Take a look at this please
http://ottopress.com/2011/tutorial-using-the-wp_filesystem/

*----*
*Emil Uzelac* | ThemeID | T: 224-444-0006 | Twitter: @EmilUzelac | E:
emil at themeid.com | http://themeid.com
Make everything as simple as possible, but not simpler. - Albert Einstein



On Mon, May 23, 2011 at 4:42 PM, Syahir Hakim <khairulsyahir at gmail.com>wrote:

> Hi everyone,
>
> I intend to use file_get_contents() to implement an option in my theme
> where users and/or developers can export and import the theme settings. As
> the number of options available in theme continue to expand, this will be a
> very convenient and useful feature, especially for developers who are
> customising the theme and setting it up locally to quickly deploy it on a
> live server, rather than going through each and every settings again. Note
> though that this only concerns the theme's settings, and not WordPress.
>
> Me and the other developer for the theme intend to use file_get_contents()
> to read in the json-encoded exported theme settings files when it is
> uploaded, but as I understand there's a blanket ban on the usage of file
> operations functions. The file will be handled using the wp_handle_upload()
> function, and it doesn't need to be retained after the contents are read.
> And since json_encode() and json_decode() functions are only available since
> PHP 5.2.1, the theme will display a message saying that the theme settings
> import/export feature is not available to those users.
>
> Note that this settings is intended to make things easier for the theme
> users and those who are developing a site based on the theme. It will not
> cause any performance issue at all in the front end. Please let me know if
> the use of file_get_contents() can be allowed for this specific case, or if
> not, what are the alternatives that I may consider.
>
> Thanks!
>
> --
> Regards,
> Syahir Hakim
>
> Contact:
> http://www.khairul-syahir.com
> +6421 0333 649
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110523/a48aa02b/attachment.htm>


More information about the theme-reviewers mailing list