ddw_wcde_plugin_advise_activation

Show user message once in the admin to point to legal information.

Description

ddw_wcde_plugin_advise_activation(); 

Usage

  1. if ( !function_exists( 'ddw_wcde_plugin_advise_activation' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-german-de_de/includes/wcde-admin-extras.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ddw_wcde_plugin_advise_activation(); 
  7.  

Defined (1)

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

/includes/wcde-admin-extras.php  
  1. function ddw_wcde_plugin_advise_activation() { 
  2.  
  3. /** Bail early if message was shown already */ 
  4. if ( TRUE === get_option( 'wcde-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( 'wcde-display-activation-message' ) 
  15. && ( 'plugins' === $screen->id || in_array( $screen->id, ddw_wcde_get_woocommerce_screen_ids() ) ) 
  16. ) { 
  17.  
  18. /** Add our helper option */ 
  19. add_option( 'wcde-display-activation-message', TRUE ); 
  20.  
  21. /** Setup user notice */ 
  22. $wcde_notice = '<div class="error"><p>'; 
  23. $wcde_notice .= sprintf( 
  24. '<strong>' . __( 'Important legal advise for %1$s plugin', 'woocommerce-german' ) . ':</strong> ' . __( 'Please read the information %2$shere on translations%3$s and %4$shere on settings%3$s!', 'woocommerce-german' ) . ' —<em>' . __( 'Thank You!', 'woocommerce-german' ) . '</em>',  
  25. '<em>' . __( 'WooCommerce German (de_DE)', 'woocommerce-german' ) . '</em>',  
  26. '<a href="' . admin_url( 'index.php?page=deckerweb-translations&tab=woocommerce-german' ) . '">',  
  27. '</a>',  
  28. '<a href="' . admin_url( ddw_wcde_woocommerce_settings_link() . '&tab=wcdetranslations' ) . '">' 
  29. ); 
  30. $wcde_notice .= '<div class="alignright"><small>(' . __( 'This message will only be shown once. Go to any other page/ screen here and it will disappear.', 'woocommerce-german' ) . ')</small></div><div class="clear"></div>'; 
  31. $wcde_notice .= '</p></div><!-- /.error -->'; 
  32.  
  33. /** Output the user message */ 
  34. echo $wcde_notice; 
  35.  
  36. } // end if 
  37.  
  38. } // end of function ddw_wcde_plugin_advise_activation