nf_modify_attachments

The Ninja Forms nf modify attachments function.

Description

nf_modify_attachments( $files, $n_id ); 

Parameters (2)

0. $files
The files.
1. $n_id
The id.

Usage

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

Defined (1)

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

/deprecated/includes/deprecated.php  
  1. function nf_modify_attachments( $files, $n_id ) { 
  2. global $ninja_forms_processing; 
  3.  
  4. if ( Ninja_Forms()->notification( $n_id )->get_setting( 'admin_email' ) ) { 
  5. if ( is_array( $ninja_forms_processing->get_form_setting( 'admin_attachments' ) ) ) { 
  6. $files = array_merge( $files, $ninja_forms_processing->get_form_setting( 'admin_attachments' ) ); 
  7. } else if ( Ninja_Forms()->notification( $n_id )->get_setting( 'user_email' ) ) { 
  8. if ( is_array( $ninja_forms_processing->get_form_setting( 'user_attachments' ) ) ) { 
  9. $files = array_merge( $files, $ninja_forms_processing->get_form_setting( 'user_attachments' ) ); 
  10.  
  11. $ninja_forms_processing->update_form_setting( 'admin_attachments', '' ); 
  12.  
  13. return $files;