<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Arial">Thanks, Satish. That'll come in
handy :)</font></font><br>
<pre class="moz-signature" cols="72">--
Regards,
Syahir Hakim
Contact:
<a class="moz-txt-link-freetext" href="http://www.khairul-syahir.com">http://www.khairul-syahir.com</a>
+64(21) 0333 649</pre>
<br>
On 21/10/2010 10:16 AM, Satish Gandham wrote:
<blockquote
cite="mid:AANLkTinAhRF39tSxLRB5emdvOJ52gzYEYU5tE2wNVEuz@mail.gmail.com"
type="cite">This is the code i used when i decided to use array
for storing options in my theme.<br>
Code is self explanatory, feel free to contact me if you have any
questions.<br>
<br>
<?php<br>
function on_theme_activation(){<br>
if ( get_option('swift_activation_check')!="set" ){<br>
//Checking if the user used the theme before<br>
//Pick some variable from your theme and see if its set<br>
if(get_option('swift_logo_url')){<br>
foreach ($swift_options as $value) {<br>
$swift_opt[$value['id']]=get_option($value['id']);<br>
delete_option($value['id']); <br>
}<br>
update_option('swift_opt',$swift_opt); <br>
}<br>
} <br>
// Add marker so it doesn't run in future<br>
update_option('swift_activation_check', "set");<br>
<br>
}<br>
add_action('admin_head', 'first_run_options');<br>
?><br>
<br>
<br>
Satish Gandham<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
theme-reviewers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a>
<a class="moz-txt-link-freetext" href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a>
</pre>
</blockquote>
</body>
</html>