WordPress.org

Make WordPress Core

Changeset 8474


Ignore:
Timestamp:
07/28/2008 08:28:56 PM (10 years ago)
Author:
mdawaffe
Message:

crazyhorse: media postbox

Location:
branches/crazyhorse/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/crazyhorse/wp-admin/edit-form-advanced.php

    r8427 r8474  
    5555}
    5656add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'side', 'core');
     57
     58//crazyhorse
     59function 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&amp;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&amp;attachment_id=$att->ID'>Edit</a>";
     85
     86        echo "<br class='clear' />";
     87    }
     88
     89
     90
     91}
     92add_meta_box( 'mediadiv', __('Media added to this Post' ), 'post_media_meta_box', 'post', 'side', 'core' );
     93
     94
     95
    5796
    5897function post_categories_meta_box($post) {
  • branches/crazyhorse/wp-admin/wp-admin.css

    r8472 r8474  
    10551055    position: relative;
    10561056    min-width: 195px;
     1057}
     1058
     1059
     1060#mediadiv img {
     1061    float: left;
     1062    margin-right: 1em;
     1063}
     1064
     1065#mediadiv h4 {
     1066    margin: 0 0 .5em;
    10571067}
    10581068
Note: See TracChangeset for help on using the changeset viewer.