bws_plugins_admin_init

The Google Sitemap by BestWebSoft bws plugins admin init function.

Description

bws_plugins_admin_init(); 

Usage

  1. if ( !function_exists( 'bws_plugins_admin_init' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-sitemap-by-bestwebsoft/bws_menu/bws_functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bws_plugins_admin_init(); 
  7.  

Defined (1)

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

/bws_menu/bws_functions.php  
  1. function bws_plugins_admin_init() { 
  2.  
  3. if ( isset( $_GET['bws_activate_plugin'] ) && check_admin_referer( 'bws_activate_plugin' . $_GET['bws_activate_plugin'] ) ) { 
  4.  
  5. $plugin = isset( $_GET['bws_activate_plugin'] ) ? $_GET['bws_activate_plugin'] : '';  
  6. $result = activate_plugin( $plugin, '', is_network_admin() );  
  7. if ( is_wp_error( $result ) ) { 
  8. if ( 'unexpected_output' == $result->get_error_code() ) { 
  9. $redirect = self_admin_url( 'admin.php?page=bws_panel&error=true&charsout=' . strlen( $result->get_error_data() ) . '&plugin=' . $plugin ); 
  10. wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) ); 
  11. exit(); 
  12. } else { 
  13. wp_die( $result ); 
  14.  
  15. if ( ! is_network_admin() ) { 
  16. $recent = (array) get_option( 'recently_activated' ); 
  17. unset( $recent[ $plugin ] ); 
  18. update_option( 'recently_activated', $recent ); 
  19. } else { 
  20. $recent = (array) get_site_option( 'recently_activated' ); 
  21. unset( $recent[ $plugin ] ); 
  22. update_site_option( 'recently_activated', $recent ); 
  23. wp_redirect( self_admin_url( 'admin.php?page=bws_panel&activate=true' ) ); 
  24. exit(); 
  25.  
  26. if ( isset( $_GET['page'] ) && $_GET['page'] == 'bws_panel' ) { 
  27. if ( ! session_id() ) 
  28. @session_start(); 
  29.