I'm quite newbie in PHP and plugin development, and I think I'm missing something obvious but I dont know how to do it.
When I activate my plugin (it adds some menu items), everything it's ok except I have to refresh the page to see those items, I that that items appers automatically when the plugin is activated.
I have this to run on activation hook (do I have to add something inside that hook):
Thanks
//////// Run on activation
function to_do_on_activation() {
cgs_create_page();
set_static_front_page();
cptui_register_my_cpt_frontiles();
cptui_register_my_taxes_tiles_categories();
insert_term();
cgs_create_tiles();
cgs_create_page();
set_static_front_page();
updateTheme('Creative_Grid');
}
register_activation_hook( __FILE__, 'to_do_on_activation' );
No I realize that there is an error when activating the plugin with TGM plugin that it's interfering in the normal process of activation (refreshing the page).
The plugin is activated but I have this warning "The plugin generated unexpected output."