Created
          August 22, 2016 09:04 
        
      - 
      
- 
        Save max-kk/c826ecf61bf7e9cfce1b56c235011372 to your computer and use it in GitHub Desktop. 
    Add first photo data to upload response array (in wp-foto-vote\public\class-fv-public-ajax.php)
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| add_filter('fv/public/upload/response', 'fv_upload_add_photo_data', 11, 1); | |
| function fv_upload_add_photo_data($response) { | |
| if ( !empty($response['inserted_photo_ids'][0]) ) { | |
| $photo0 = ModelCompetitors::query()->findByPK( $response['inserted_photo_ids'][0] ); | |
| if ( !empty($photo0) ) { | |
| $response['inserted_photo_datas'][0] = FV_Public::_prepare_contestant_to_js($photo0); | |
| } | |
| } | |
| return $response; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | FvLib.addHook('fv/upload/ready', function(data){ | |
| // data.inserted_photo_datas[0].url - Photo full url | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment