calderawpcfeddfieldsprocessor

The Caldera Forms EDD calderawp cfeddfields processor class.

Defined (1)

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

/vendor/calderawp/cf-edd-fields/src/processor.php  
  1. class processor extends \Caldera_Forms_Processor_Processor { 
  2.  
  3.  
  4. /** 
  5. * @inheritdoc 
  6. */ 
  7. public function pre_processor( array $config, array $form, $proccesid ) { 
  8. $this->set_data_object_initial( $config, $form ); 
  9. $value = $this->data_object->get_value( 'edd_licensed_downloads' ); 
  10. $_user = $this->data_object->get_value( 'edd_licensed_downloads_user' ); 
  11. if ( 0 < absint( $_user ) ) { 
  12. $user = $_user; 
  13. }else{ 
  14. $user = get_current_user_id(); 
  15.  
  16.  
  17. $downloads = license::get_downloads_by_licensed_user( $user ); 
  18.  
  19. if ( ! is_array( $downloads ) || ! in_array( $value, array_keys( $downloads ) ) ) { 
  20. if( '' != $this->data_object->get_value( 'edd_licensed_downloads_none' ) ? $message = $this->data_object->get_value( 'edd_licensed_downloads_none' ) : $message = __( 'No license downloads found for this user.', 'cf-edd' ) ); 
  21. return array( 
  22. 'type'=>'error',  
  23. 'note' => $message 
  24.  
  25. ); 
  26.  
  27. $this->setup_transata( $proccesid ); 
  28.  
  29.  
  30. public function processor( array $config, array $form, $proccesid ) {} 
  31.  
  32.