cptui_make_activation_redirect

Redirect user to CPTUI about page upon plugin activation.

Description

cptui_make_activation_redirect(); 

Usage

  1. if ( !function_exists( 'cptui_make_activation_redirect' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-post-type-ui/custom-post-type-ui.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = cptui_make_activation_redirect(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/custom-post-type-ui.php  
  1. function cptui_make_activation_redirect() { 
  2.  
  3. if ( ! get_transient( 'cptui_activation_redirect' ) ) { 
  4. return; 
  5.  
  6. delete_transient( 'cptui_activation_redirect' ); 
  7.  
  8. // Bail if activating from network, or bulk. 
  9. if ( is_network_admin() ) { 
  10. return; 
  11.  
  12. if ( ! cptui_is_new_install() ) { 
  13. return; 
  14.  
  15. // Redirect to CPTUI about page. 
  16. wp_safe_redirect( 
  17. add_query_arg( 
  18. array( 'page' => 'cptui_main_menu' ),  
  19. cptui_admin_url( 'admin.php?page=cptui_main_menu' ) 
  20. );