[theme-reviewers] Theme Activation Hook
Konstantin Kovshenin
kovshenin at gmail.com
Thu Oct 24 08:35:11 UTC 2013
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:
https://codex.wordpress.org/Function_Reference/get_theme_mod
On Thu, Oct 24, 2013 at 12:30 PM, Towfiq I. <tislam100 at gmail.com> wrote:
> Are we allowed to use:
>
> *if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php"
> ) {**}*
> *
> *
> *
> *
> *example:*
> *---------------------
> *if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php"
> ) {
> $option_default_values = array(
> "block1_text_id" => "Lorem Ipsum",
> "block1_textarea_id" => "Lorem Ipsum blah blah blah");
>
> update_option('theme_options', $option_default_values);
> }
> --------------------------
>
> if we are not, what should we use instead?
> after_setup_theme doesnt work btw.
>
> or should we use after_switch_theme?
>
> Thanks
> --
> Towfiq I.
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
--
Konstantin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20131024/d6de9537/attachment.html>
More information about the theme-reviewers
mailing list