bws_plugin_banner

The Google Sitemap by BestWebSoft bws plugin banner function.

Description

Parameters (6)

0. $plugin_info
The plugin info.
1. $this_banner_prefix
The this banner prefix.
2. $link_slug
The link slug.
3. $link_key
The link key.
4. $link_pn
The link pn.
5. $banner_url_or_slug
The banner url or slug.

Usage

  1. if ( !function_exists( 'bws_plugin_banner' ) ) { 
  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 this banner prefix. 
  8. $this_banner_prefix = null; 
  9.  
  10. // The link slug. 
  11. $link_slug = null; 
  12.  
  13. // The link key. 
  14. $link_key = null; 
  15.  
  16. // The link pn. 
  17. $link_pn = null; 
  18.  
  19. // The banner url or slug. 
  20. $banner_url_or_slug = null; 
  21.  
  22. // NOTICE! Understand what this does before running. 
  23. $result = bws_plugin_banner($plugin_info, $this_banner_prefix, $link_slug, $link_key, $link_pn, $banner_url_or_slug); 
  24.  

Defined (1)

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

/bws_menu/bws_functions.php  
  1. function bws_plugin_banner( $plugin_info, $this_banner_prefix, $link_slug, $link_key, $link_pn, $banner_url_or_slug ) { 
  2. global $wp_version, $bstwbsftwppdtplgns_cookie_add, $bstwbsftwppdtplgns_banner_array; 
  3.  
  4. if ( empty( $bstwbsftwppdtplgns_banner_array ) ) { 
  5. if ( ! function_exists( 'bws_get_banner_array' ) ) 
  6. require_once( dirname( __FILE__ ) . '/bws_menu.php' ); 
  7.  
  8. if ( false == strrpos( $banner_url_or_slug, '/' ) ) { 
  9. $banner_url_or_slug = '//ps.w.org/' . $banner_url_or_slug . '/assets/icon-128x128.png'; 
  10.  
  11. if ( ! function_exists( 'is_plugin_active' ) ) 
  12. require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 
  13.  
  14. $all_plugins = get_plugins(); 
  15.  
  16. $this_banner = $this_banner_prefix . '_hide_banner_on_plugin_page'; 
  17. foreach ( $bstwbsftwppdtplgns_banner_array as $key => $value ) { 
  18. if ( $this_banner == $value[0] ) { 
  19. if ( ! isset( $bstwbsftwppdtplgns_cookie_add ) ) { 
  20. echo '<script type="text/javascript" src="' . plugins_url( 'js/c_o_o_k_i_e.js', __FILE__ ) . '"></script>'; 
  21. $bstwbsftwppdtplgns_cookie_add = true; 
  22. } ?> 
  23. <script type="text/javascript"> 
  24. (function($) { 
  25. $(document).ready( function() { 
  26. var hide_message = $.cookie( '<?php echo $this_banner_prefix; ?>_hide_banner_on_plugin_page' ); 
  27. if ( hide_message == "true" ) { 
  28. $( ".<?php echo $this_banner_prefix; ?>_message" ).css( "display", "none" ); 
  29. } else { 
  30. $( ".<?php echo $this_banner_prefix; ?>_message" ).css( "display", "block" ); 
  31. }; 
  32. $( ".<?php echo $this_banner_prefix; ?>_close_icon" ).click( function() { 
  33. $( ".<?php echo $this_banner_prefix; ?>_message" ).css( "display", "none" ); 
  34. $.cookie( "<?php echo $this_banner_prefix; ?>_hide_banner_on_plugin_page", "true", { expires: 32 } ); 
  35. }); 
  36. }); 
  37. })(jQuery); 
  38. </script> 
  39. <div class="updated" style="padding: 0; margin: 0; border: none; background: none;"> 
  40. <div class="<?php echo $this_banner_prefix; ?>_message bws_banner_on_plugin_page bws_go_pro_banner" style="display: none;"> 
  41. <button class="<?php echo $this_banner_prefix; ?>_close_icon close_icon notice-dismiss bws_hide_settings_notice" title="<?php _e( 'Close notice', 'bestwebsoft' ); ?>"></button> 
  42. <div class="icon"> 
  43. <img title="" src="<?php echo esc_attr( $banner_url_or_slug ); ?>" alt="" /> 
  44. </div>  
  45. <div class="text"><?php 
  46. _e( 'It*s time to upgrade your', 'bestwebsoft' ); ?> <strong><?php echo $plugin_info['Name']; ?> plugin</strong> <?php _e( 'to', 'bestwebsoft' ); ?> <strong>Pro</strong> <?php _e( 'version!', 'bestwebsoft' ); ?><br /> 
  47. <span><?php _e( 'Extend standard plugin functionality with new great options.', 'bestwebsoft' ); ?></span> 
  48. </div> 
  49. <div class="button_div"> 
  50. <a class="button" target="_blank" href="http://bestwebsoft.com/products/<?php echo $link_slug; ?>/?k=<?php echo $link_key; ?>&pn=<?php echo $link_pn; ?>&v=<?php echo $plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>"><?php _e( 'Learn More', 'bestwebsoft' ); ?></a> 
  51. </div> 
  52. </div> 
  53. </div> 
  54. <?php break; 
  55. if ( isset( $all_plugins[ $value[1] ] ) && $all_plugins[ $value[1] ]["Version"] >= $value[2] && is_plugin_active( $value[1] ) && ! isset( $_COOKIE[ $value[0] ] ) ) { 
  56. break;