<div dir="ltr">Why are you trying to write the default options to the database? You can just use $options = get_option( 'your_theme_options', $defaults ); and update them only if they've changed on your options page. I would also suggest looking into theme mods and not options: <a href="https://codex.wordpress.org/Function_Reference/get_theme_mod">https://codex.wordpress.org/Function_Reference/get_theme_mod</a></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 24, 2013 at 12:30 PM, Towfiq I. <span dir="ltr"><<a href="mailto:tislam100@gmail.com" target="_blank">tislam100@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Are we allowed to use:<div><br></div><div><b>if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) {</b><b>}</b></div><div><b><br></b></div><div><b><br>
</b></div><div><b>example:</b></div><div><b>---------------------<br></b>if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) {<div> $option_default_values = array(</div>
<div>"block1_text_id" => "Lorem Ipsum",<br></div><div>"block1_textarea_id" => "Lorem Ipsum blah blah blah");<br></div><div><br></div><div>update_option('theme_options', $option_default_values);<br>
</div><div>}<br clear="all"><div>--------------------------</div><div><br></div><div>if we are not, what should we use instead? </div><div>after_setup_theme doesnt work btw. </div><div><br></div><div>or should we use after_switch_theme?</div>
<div><br></div><div>Thanks</div><span class="HOEnZb"><font color="#888888">-- <div><span style="color:rgb(153,153,153)">Towfiq I.</span><br>
</div></font></span></div></div></div>
<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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Konstantin
</div>