bws_plugin_banner_to_settings

The Google Sitemap by BestWebSoft bws plugin banner to settings function.

Description

bws_plugin_banner_to_settings( $plugin_info, (string) $plugin_options_name, $banner_url_or_slug, $settings_url, (bool) $post_type_url = false ); 

Parameters (5)

0. $plugin_info
The plugin info.
1. $plugin_options_name (string)
The plugin options name.
2. $banner_url_or_slug
The banner url or slug.
3. $settings_url
The settings url.
4. $post_type_url — Optional. (bool) => false
The post type url.

Usage

  1. if ( !function_exists( 'bws_plugin_banner_to_settings' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-sitemap-by-bestwebsoft/bws_menu/bws_functions.php'; 
  3.  
  4. // The plugin info. 
  5. $plugin_info = null; 
  6.  
  7. // The plugin options name. 
  8. $plugin_options_name = ''; 
  9.  
  10. // The banner url or slug. 
  11. $banner_url_or_slug = null; 
  12.  
  13. // The settings url. 
  14. $settings_url = null; 
  15.  
  16. // The post type url. 
  17. $post_type_url = false; 
  18.  
  19. // NOTICE! Understand what this does before running. 
  20. $result = bws_plugin_banner_to_settings($plugin_info, $plugin_options_name, $banner_url_or_slug, $settings_url, $post_type_url); 
  21.  

Defined (1)

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

/bws_menu/bws_functions.php  
  1. function bws_plugin_banner_to_settings( $plugin_info, $plugin_options_name, $banner_url_or_slug, $settings_url, $post_type_url = false ) { 
  2. global $wp_version, $bws_plugin_banner_to_settings; 
  3.  
  4. $is_network_admin = is_network_admin(); 
  5.  
  6. $plugin_options = $is_network_admin ? get_site_option( $plugin_options_name ) : get_option( $plugin_options_name ); 
  7.  
  8. if ( isset( $plugin_options['display_settings_notice'] ) && 0 == $plugin_options['display_settings_notice'] ) 
  9. return; 
  10.  
  11. if ( isset( $_POST['bws_hide_settings_notice_' . $plugin_options_name ] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bws_settings_nonce_name' ) ) { 
  12. $plugin_options['display_settings_notice'] = 0; 
  13. if ( $is_network_admin ) 
  14. update_site_option( $plugin_options_name, $plugin_options ); 
  15. else 
  16. update_option( $plugin_options_name, $plugin_options ); 
  17. return; 
  18.  
  19. if ( false == strrpos( $banner_url_or_slug, '/' ) ) { 
  20. $banner_url_or_slug = '//ps.w.org/' . $banner_url_or_slug . '/assets/icon-128x128.png'; 
  21. }  
  22.  
  23. $bws_plugin_banner_to_settings[] = array( 
  24. 'plugin_info' => $plugin_info,  
  25. 'plugin_options_name' => $plugin_options_name,  
  26. 'banner_url' => $banner_url_or_slug,  
  27. 'settings_url' => $settings_url,  
  28. 'post_type_url' => $post_type_url 
  29. );