- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 1 and 9 items
- Europe
- Exclusive Author
- Has been a member for 2-3 years
- Item was Featured
- Referred between 100 and 199 users
could you post the code here please for other guys like me?:D
could you post the code here please for other guys like me?:D
+1, please share 
- Envato Staff
- Reviewer
- Community Moderator
- Venezuela
- Has been a member for 4-5 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Microlancer Beta Tester
- Sold between 10 000 and 50 000 dollars
- Exclusive Author
could you post the code here please for other guys like me?:D
+1 
- Microlancer Beta Tester
- Sold between 250 000 and 1 000 000 dollars
- Author was Featured
- Item was Featured
- Has been a member for 4-5 years
- Author had a File in an Envato Bundle
- Referred between 200 and 499 users
- Author had a Free File of the Month
This is what I use:
if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) {
//Call action that sets
add_action('admin_head','ct_option_setup');
//Do redirect
header( 'Location: '.admin_url().'admin.php?page=options_panel.php' ) ;
}
- Bought between 10 and 49 items
- Exclusive Author
- Has been a member for 5-6 years
- Referred between 1 and 9 users
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 5 000 and 10 000 dollars
- Uruguay
I guess that code wil work on a custom admin page, but if you have a simple Theme Optioins page, the path url and php page is different.
In that case i use this in my functions.php:
function my_options_add_page() {
add_theme_page( __( 'Theme Options' ), __( 'Theme Options' ), 'administrator', 'your-theme-options-page-slug', 'my_options_do_options');
}
function my_options_do_options(){
// do the options page here....
}
add_action( 'admin_menu', 'my_options_add_page' );
if ($_GET['activated']){
wp_redirect(admin_url("themes.php?page=your-theme-options-page-slug"));
}
So, once theme is actived, it redirects to the Appereance > Theme Options page, which acctualy is the my_options_do_options function. I don´t need to tell the IF if i´m on themes page, since the $_GET[‘activated’] is only used there. Also, i don´t need to tell that IF ´m administrator, since the add_theme_page is restricted for “administrator” level as you can see on code.
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Item was Featured
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Europe
- Exclusive Author
- Has been a member for 4-5 years
- Referred between 100 and 199 users
This is what I use:if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) { //Call action that sets add_action('admin_head','ct_option_setup'); //Do redirect header( 'Location: '.admin_url().'admin.php?page=options_panel.php' ) ; }
Where do you place this code? in the wp-includes/function.php file?
- Author had a Free File of the Month
- Author was Featured
- Bought between 1 and 9 items
- Exclusive Author
- Has been a member for 4-5 years
- Most Wanted Bounty Winner
- Referred between 1 and 9 users
- Repeatedly Helped protect Envato Marketplaces against copyright violations
I guess that code wil work on a custom admin page, but if you have a simple Theme Optioins page, the path url and php page is different.In that case i use this in my functions.php:
function my_options_add_page() { add_theme_page( __( 'Theme Options' ), __( 'Theme Options' ), 'administrator', 'your-theme-options-page-slug', 'my_options_do_options'); } function my_options_do_options(){ // do the options page here.... } add_action( 'admin_menu', 'my_options_add_page' ); if ($_GET['activated']){ wp_redirect(admin_url("themes.php?page=your-theme-options-page-slug")); }
The above code worked me perfectly. Thanks rg 
- Author had a Free File of the Month
- Author was Featured
- Bought between 1 and 9 items
- Exclusive Author
- Has been a member for 4-5 years
- Most Wanted Bounty Winner
- Referred between 1 and 9 users
- Repeatedly Helped protect Envato Marketplaces against copyright violations
This is what I use:Where do you place this code? in the wp-includes/function.php file?if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) { //Call action that sets add_action('admin_head','ct_option_setup'); //Do redirect header( 'Location: '.admin_url().'admin.php?page=options_panel.php' ) ; }
yes you need to add it in function.php
- Envato Staff
- Reviewer
- Community Moderator
- Venezuela
- Has been a member for 4-5 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Microlancer Beta Tester
- Sold between 10 000 and 50 000 dollars
- Exclusive Author
Thanks guys that will be very helpful for my next theme.
- Bought between 10 and 49 items
- Exclusive Author
- Has been a member for 5-6 years
- Referred between 1 and 9 users
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 5 000 and 10 000 dollars
- Uruguay
This is what I use:Where do you place this code? in the wp-includes/function.php file?if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) { //Call action that sets add_action('admin_head','ct_option_setup'); //Do redirect header( 'Location: '.admin_url().'admin.php?page=options_panel.php' ) ; }
You don´t need to touch the wp includes, just in your theme/functions.php file.
