Guest User

Custom Control

a guest
Jul 11th, 2018
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.66 KB | None | 0 0
  1. $ids    =   explode( ',', $this->value() );
  2.                                 foreach ( $ids as $attachment_id ) {
  3.                                     if ($attachment_id  != '' ) :
  4.                                        
  5.                                         $edit_fields    =   get_attachment_fields_to_edit( get_post( $attachment_id ) );
  6.                                        
  7.                                         $img = wp_get_attachment_image_src( $attachment_id, 'large' ); ?>
  8.                                         <div class="slide-image">
  9.                                             <img src=" <?php echo esc_url( $img[0] ); ?> " data-id=" <?php echo $attachment_id ?> ">
  10.                                             <div class="slide-title">
  11.                                                 <h3>
  12.                                                     <?php echo $edit_fields['post_title']['label']; ?>
  13.                                                 </h3>
  14.                                                 <?php echo $edit_fields['post_title']['html']; ?>
  15.                                             </div>
  16.                                             <div class="slide-description">
  17.                                                 <h3>
  18.                                                     <?php echo $edit_fields['post_content']['label']; ?>
  19.                                                 </h3>
  20.                                                 <?php echo $edit_fields['post_content']['html']; ?>
  21.                                             </div>
  22.                                             <div class="slide-url">
  23.                                                 <h3>
  24.                                                     <?php echo $edit_fields['rtslider_link']['label']; ?>
  25.                                                 </h3>
  26.                                                 <?php echo $edit_fields['rtslider_link']['html']; ?>
  27.                                             </div>
  28.                                             <div class="slide-url">
  29.                                                 <h3>
  30.                                                     <?php echo $edit_fields['cta_button']['label']; ?>
  31.                                                 </h3>
  32.                                                 <?php echo $edit_fields['cta_button']['html']; ?>
  33.                                             </div>
  34.                                            
  35.                                            
  36.                                             <button type="button" class="button remove_slide_button">Remove Slide</button>
  37.                                         </div>
  38.                                     <?php endif;
  39.                                 }
Add Comment
Please, Sign In to add comment