nf_admin_notices

Notices page to house all of the admin notices for Core.

Description

nf_admin_notices( $notices ); 

Can be simply used be adding another line into the nf_admin_notices" title="nf_admin_notices" class="code function">nf_admin_notices() function

The class NF_Notices in notices-class.php can be extended to create more advanced notices to include triggered events

Parameters (1)

0. $notices
The notices.

Usage

  1. if ( !function_exists( 'nf_admin_notices' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/admin/notices.php'; 
  3.  
  4. // The notices. 
  5. $notices = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = nf_admin_notices($notices); 
  9.  

Defined (1)

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

/deprecated/includes/admin/notices.php  
  1. functionnf_admin_notices $notices ) { 
  2.  
  3.  
  4.  
  5. /** 
  6. * Upgrade Now 
  7. */ 
  8. $upgrade_link = admin_url( 'admin.php?page=ninja-forms-three' ); 
  9. $notices['three_upgrade'] = array( 
  10. 'title' => __( 'Upgrade to Ninja Forms THREE', 'ninja-forms' ),  
  11. 'msg' => sprintf( __( 'You are eligible to upgrade to Ninja Forms THREE! %sUpgrade Now%s', 'ninja-forms' ), '<a target="_blank" href="' . $upgrade_link . '">', '</a>' ),  
  12. 'link' => '',  
  13. 'int' => 0,  
  14. 'blacklist' => array( 'ninja-forms', 'ninja-forms-three' ),  
  15. ); 
  16.  
  17. } else { 
  18.  
  19. /** 
  20. * THREE is Coming! 
  21. */ 
  22. $three_info = add_query_arg( array( 'nf_admin_notice_ignore' => 'three_info' ) ); 
  23. $three_link = nf_aff_link( 'https://ninjaforms.com/three/?utm_medium=plugin&utm_source=admin-notice&utm_campaign=Ninja+Forms+THREE&utm_content=Learn+More' ); 
  24. $notices['three_info'] = array( 
  25. 'title' => __( 'THREE is coming!', 'ninja-forms' ),  
  26. 'msg' => sprintf( __( 'A major update is coming to Ninja Forms. %sLearn more about new features, backwards compatibility, and more Frequently Asked Questions.%s', 'ninja-forms' ), '<a target="_blank" href="' . $three_link . '">', '</a>' ),  
  27. 'link' => '',  
  28. 'int' => 0,  
  29. 'blacklist' => array( 'ninja-forms', 'ninja-forms-three' ),  
  30. ); 
  31.  
  32.  
  33.  
  34.  
  35. $one_week_support = add_query_arg( array( 'nf_admin_notice_ignore' => 'one_week_support' ) ); 
  36. $support_link = nf_aff_link( 'https://ninjaforms.com/contact/?utm_medium=plugin&utm_source=admin-notice&utm_campaign=Ninja+Forms+Upsell&utm_content=Ninja+Forms+Support' ); 
  37. $support_docs_link = nf_aff_link( 'http://docs.ninjaforms.com/?utm_medium=plugin&utm_source=admin-notice&utm_campaign=Ninja+Forms+Upsell&utm_content=Ninja+Forms+Docs' ); 
  38. $notices['one_week_support'] = array( 
  39. 'title' => __( 'How\'s It Going?', 'ninja-forms' ),  
  40. 'msg' => __( 'Thank you for using Ninja Forms! We hope that you\'ve found everything you need, but if you have any questions:', 'ninja-forms' ),  
  41. 'link' => '<li><span class="dashicons dashicons-media-text"></span><a target="_blank" href="' . $support_docs_link . '">' . __( 'Check out our documentation', 'ninja-forms' ) . '</a></li> 
  42. <li><span class="dashicons dashicons-sos"></span><a target="_blank" href="' . $support_link . '">' . __( 'Get Some Help' , 'ninja-forms' ) . '</a></li> 
  43. <li><span class="dashicons dashicons-dismiss"></span><a href="' . $one_week_support . '">' . __( 'Dismiss' , 'ninja-forms' ) . '</a></li>',  
  44. 'int' => 7,  
  45. 'blacklist' => array( 'ninja-forms-three' ),  
  46. ); 
  47.  
  48. // $two_week_review_ignore = add_query_arg( array( 'nf_admin_notice_ignore' => 'two_week_review' ) ); 
  49. // $two_week_review_temp = add_query_arg( array( 'nf_admin_notice_temp_ignore' => 'two_week_review', 'int' => 14 ) ); 
  50. // $notices['two_week_review'] = array( 
  51. // 'title' => __( 'Leave A Review?', 'ninja-forms' ),  
  52. // 'msg' => __( 'We hope you\'ve enjoyed using Ninja Forms! Would you consider leaving us a review on WordPress.org?', 'ninja-forms' ),  
  53. // 'link' => '<li> <span class="dashicons dashicons-smiley"></span><a href="' . $two_week_review_ignore . '"> ' . __( 'I\'ve already left a review', 'ninja-forms' ) . '</a></li> 
  54. // <li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $two_week_review_temp . '">' . __( 'Maybe Later' , 'ninja-forms' ) . '</a></li> 
  55. // <li><span class="dashicons dashicons-external"></span><a href="http://wordpress.org/support/view/plugin-reviews/ninja-forms?filter=5" target="_blank">' . __( 'Sure! I\'d love to!', 'ninja-forms' ) . '</a></li>',  
  56. // 'int' => 14 
  57. // ); 
  58.  
  59.  
  60. return $notices;