ninja_forms_save_metabox_state

The Ninja Forms ninja forms save metabox state function.

Description

ninja_forms_save_metabox_state(); 

Usage

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

Defined (1)

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

/deprecated/includes/admin/ajax.php  
  1. function ninja_forms_save_metabox_state() { 
  2. // Bail if we aren't in the admin 
  3. if ( ! is_admin() ) 
  4. return false; 
  5.  
  6. check_ajax_referer( 'nf_ajax', 'nf_ajax_nonce' ); 
  7.  
  8. $plugin_settings = nf_get_settings(); 
  9. $page = esc_html( $_REQUEST['page'] ); 
  10. $tab = esc_html( $_REQUEST['tab'] ); 
  11. $slug = esc_html( $_REQUEST['slug'] ); 
  12. $metabox_state = esc_html( $_REQUEST['metabox_state'] ); 
  13. $plugin_settings['metabox_state'][$page][$tab][$slug] = $metabox_state; 
  14. update_option( 'ninja_forms_settings', $plugin_settings ); 
  15.  
  16. die();