ninja_forms_display_form_visibility

The Ninja Forms ninja forms display form visibility function.

Description

ninja_forms_display_form_visibility( $display, $form_id ); 

Parameters (2)

0. $display
The display.
1. $form_id
The form id.

Usage

  1. if ( !function_exists( 'ninja_forms_display_form_visibility' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/display/form/form-visibility.php'; 
  3.  
  4. // The display. 
  5. $display = null; 
  6.  
  7. // The form id. 
  8. $form_id = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = ninja_forms_display_form_visibility($display, $form_id); 
  12.  

Defined (1)

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

/deprecated/includes/display/form/form-visibility.php  
  1. function ninja_forms_display_form_visibility( $display, $form_id ) { 
  2. global $ninja_forms_processing; 
  3.  
  4. if( is_object( $ninja_forms_processing ) ) { 
  5. $hide_complete = $ninja_forms_processing->get_form_setting( 'hide_complete' ); 
  6. }else{ 
  7. $hide_complete = Ninja_Forms()->form( $form_id )->get_setting( 'hide_complete' ); 
  8.  
  9. //If the plugin setting 'hide complete' has been set and a success message exists, hide the form. 
  10. if( $hide_complete == 1 AND ( is_object( $ninja_forms_processing ) AND $ninja_forms_processing->get_form_setting( 'processing_complete' ) == 1 ) AND $ninja_forms_processing->get_form_ID() == $form_id ) { 
  11. $display = 0; 
  12.  
  13. return $display;