| | 57 | |
|---|
| | 58 | //crazyhorse |
|---|
| | 59 | function post_media_meta_box($post) { |
|---|
| | 60 | echo "<p><small><em>This feature isn't fully functional in this prototype.</em></small></p>"; |
|---|
| | 61 | |
|---|
| | 62 | $atts = get_children( array( |
|---|
| | 63 | 'post_parent' => $post->ID, |
|---|
| | 64 | 'post_type' => 'attachment' |
|---|
| | 65 | ) ); |
|---|
| | 66 | |
|---|
| | 67 | if ( !$atts ) { |
|---|
| | 68 | _e( 'No media.' ); |
|---|
| | 69 | return; |
|---|
| | 70 | } |
|---|
| | 71 | |
|---|
| | 72 | foreach ( $atts as $att ) { |
|---|
| | 73 | if ( $thumb = wp_get_attachment_image( $att->ID, array(60, 45), true ) ) { |
|---|
| | 74 | ?> |
|---|
| | 75 | <a href="media.php?action=edit&attachment_id=<?php echo $att->ID ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att->post_title)); ?>"> |
|---|
| | 76 | <?php echo $thumb; ?> |
|---|
| | 77 | </a> |
|---|
| | 78 | |
|---|
| | 79 | <?php |
|---|
| | 80 | } |
|---|
| | 81 | echo "<h4>$att->post_title</h4>"; |
|---|
| | 82 | |
|---|
| | 83 | echo "<a href='#' class='no-crazy'>Remove</a> | "; |
|---|
| | 84 | echo "<a href='media.php?action=edit&attachment_id=$att->ID'>Edit</a>"; |
|---|
| | 85 | |
|---|
| | 86 | echo "<br class='clear' />"; |
|---|
| | 87 | } |
|---|
| | 88 | |
|---|
| | 89 | |
|---|
| | 90 | |
|---|
| | 91 | } |
|---|
| | 92 | add_meta_box( 'mediadiv', __('Media added to this Post' ), 'post_media_meta_box', 'post', 'side', 'core' ); |
|---|
| | 93 | |
|---|
| | 94 | |
|---|
| | 95 | |
|---|