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

Simon Prosser pross at pross.org.uk
Mon May 23 21:49:58 UTC 2011

On 23 May 2011 22:42, 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

My Blog: http://www.pross.org.uk/
Plugins : http://www.pross.org.uk/plugins/
Themes: http://wordpress.org/extend/themes/profile/pross
-------------- next part --------------
A non-text attachment was scrubbed...
Name: popcorn-animated.gif
Type: image/gif
Size: 2944 bytes
Desc: not available
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110523/2818b616/attachment.gif>

More information about the theme-reviewers mailing list