NF_Admin_Menus_MockData

The Ninja Forms NF Admin Menus MockData class.

Defined (1)

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

/includes/Admin/Menus/MockData.php  
  1. final class NF_Admin_Menus_MockData extends NF_Abstracts_Submenu 
  2. public $parent_slug = 'ninja-forms'; 
  3.  
  4. public $page_title = 'Mock Data'; 
  5.  
  6. public $priority = 9002; 
  7.  
  8. public function __construct() 
  9. if( ! defined( 'NF_DEV' ) || ! NF_DEV ) return; 
  10.  
  11. parent::__construct(); 
  12.  
  13. if( isset( $_GET[ 'page' ] ) && 'nf-mock-data' == $_GET[ 'page' ] ) { 
  14. add_action('admin_init', array($this, 'mock_and_redirect')); 
  15.  
  16. public function mock_and_redirect() 
  17. $this->mock_data(); 
  18. wp_redirect( admin_url( 'admin.php?page=ninja-forms' ) ); 
  19. exit; 
  20.  
  21. public function display() 
  22. // Fallback if not redirected. 
  23. $this->mock_data(); 
  24. echo '<div class="wrap">' . __( 'Migrations and Mock Data complete. ', 'ninja-forms' ) . '<a href="' . 
  25. admin_url( "admin.php?page=ninja-forms" ) . '">' . __( 'View Forms', 'ninja-forms' ) . '</a></div>'; 
  26.  
  27. private function mock_data() 
  28. $mock_data = new NF_Database_MockData(); 
  29.  
  30. $mock_data->saved_fields(); 
  31. $mock_data->form_blank_form(); 
  32. $mock_data->form_contact_form_1(); 
  33. $mock_data->form_contact_form_2(); 
  34. $mock_data->form_product_1(); 
  35. $mock_data->form_product_2(); 
  36. $mock_data->form_product_3(); 
  37. $mock_data->form_email_submission(); 
  38. $mock_data->form_long_form( 100 ); 
  39. $mock_data->form_long_form( 300 ); 
  40. $mock_data->form_long_form( 500 ); 
  41. $mock_data->form_kitchen_sink(); 
  42. $mock_data->form_bathroom_sink(); 
  43. $mock_data->form_calc_form(); 
  44.  
  45. } // End Class NF_Admin_Settings