Execute action when a Wordpress theme is activated
So I want to enable "Discourage search engines from indexing this site"
option from the wordpress menu when a theme is activated.
Practically I have the trigger but I can't find the code that will do this.
$flag = get_option('theme_activation_check');
if ( $flag == false && is_admin())
{
// put your code to run when theme is activated by admin
// update option at last
update_option('theme_activation_check', 'true');
}
Any advice will be helpful. Thanks!
No comments:
Post a Comment