ddw_gftb_plugin_advise_activation

Show user message if Gravity Forms base plugin is not active yet.

Description

ddw_gftb_plugin_advise_activation(); 

Usage

  1. if ( !function_exists( 'ddw_gftb_plugin_advise_activation' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'gravity-forms-toolbar/lib/gftb-admin-extras.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ddw_gftb_plugin_advise_activation(); 
  7.  

Defined (1)

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

/lib/gftb-admin-extras.php  
  1. function ddw_gftb_plugin_advise_activation() { 
  2.  
  3. /** Bail early if message was shown already */ 
  4. if ( TRUE === get_option( 'gftb-display-activation-message' ) ) { 
  5.  
  6. return; 
  7.  
  8. } // end if 
  9.  
  10. /** Get current screen hook */ 
  11. $screen = get_current_screen(); 
  12.  
  13. /** If message was not shown yet, just show it: */ 
  14. if ( FALSE === get_option( 'gftb-display-activation-message' ) 
  15. && ! class_exists( 'RGForms' ) 
  16. && 'plugins' === $screen->id 
  17. ) { 
  18.  
  19. /** Add our helper option */ 
  20. add_option( 'gftb-display-activation-message', TRUE ); 
  21.  
  22. /** Setup user notice */ 
  23. $gftb_notice = '<div class="error"><p>'; 
  24. $gftb_notice .= sprintf( 
  25. __( 'To have %s plugin doing anything you need the %s base plugin installed and activated. You can buy the best form plugin for WordPress at %s.', 'gravity-forms-toolbar' ),  
  26. '<em>' . __( 'Gravity Forms Toolbar', 'gravity-forms-toolbar' ) . '</em>',  
  27. '<a href="http://ddwb.me/getgravityforms" target="_new">gravityforms.com</a>',  
  28. '<a href="http://ddwb.me/getgravityforms" target="_new"><strong>Gravity Forms</strong></a>' 
  29. ); 
  30. $gftb_notice .= '<div class="alignright"><small>(' . __( 'This message will only be shown once. Go to any other page/ screen here and it will disappear.', 'gravity-forms-toolbar' ) . ')</small></div><div class="clear"></div>'; 
  31. $gftb_notice .= '</p></div><!-- /.error -->'; 
  32.  
  33. /** Output the user message */ 
  34. echo $gftb_notice; 
  35.  
  36. } // end if 
  37.  
  38. } // end of function