Advertisement
verygoodplugins

Untitled

Jun 25th, 2018
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.90 KB | None | 0 0
  1. function user_profile_filebox( $user ) {
  2.  
  3.     $contact_id = wp_fusion()->user->get_contact_id( $user->ID );
  4.  
  5.     if( empty( $contact_id ) ) {
  6.         return;
  7.     }
  8.  
  9.     wp_fusion()->crm->connect();
  10.  
  11.     $fields = array( 'FileName', 'Id' );
  12.     $query  = array( 'ContactId' => $contact_id );
  13.  
  14.     $files = wp_fusion()->crm->app->dsQuery( 'FileBox', 1000, 0, $query, $fields );
  15.  
  16.     if( empty( $files ) ) {
  17.         return;
  18.     }
  19.  
  20.     ?>
  21.  
  22.     <table class="form-table">
  23.         <tr>
  24.             <th><label for="files"><?php echo wp_fusion()->crm->name ?> Files</label></th>
  25.             <td id="files">
  26.                 <ul>
  27.                 <?php foreach( $files as $file ) : ?>
  28.                     <li><?php echo $file['Id'] ?>: <?php echo $file['FileName']; ?></li>
  29.                 <?php endforeach; ?>
  30.                 </ul>
  31.             </td>
  32.         </tr>
  33.     </table>
  34.  
  35.     <?php
  36.  
  37.  
  38. }
  39.  
  40. add_action( 'show_user_profile', 'user_profile_filebox' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement