Užitečné pluginy, návody a šablony pro WordPress CMS

Přiřazení stejného obrázku více příspěvkům (opakované použití)

If you use the library and use a lot of pictures in the posts, the following small link in the library will surely help you. Thus, images can be easily reused. A link will be created so you can access the image directly and there is no need to upload the image again to your new post.

function upload_columns($columns) {
        unset($columns['parent']);
        $columns['better_parent'] = __( 'Parent' );
        return $columns;
        }

function media_custom_columns($column_name, $id) {
        $post = get_post($id);

        if ( $column_name != 'better_parent' )
        return;

        if ( $post->post_parent > 0 ) {
                if ( get_post($post->post_parent) )
                $title = _draft_or_post_title($post->post_parent);
                ?>
                <strong>
                <a href="<?php echo get_edit_post_link( $post->post_parent ); ?>"><?php echo $title ?></a>
                </strong>, <?php echo get_the_time( get_option('date_format') ); ?>
                <br />
                <a class="hide-if-no-js" onclick="findPosts.open('media[]','<?php echo $post->ID ?>');return false;" href="#the-list"><?php _e( 'Re-', 'textdomain' ); _e('Attach'); ?></a>
                <?php
        } else {
                _e( '(Unattached)' ); ?>
                <br />
                <a class="hide-if-no-js" onclick="findPosts.open('media[]','<?php echo $post->ID ?>');return false;" href="#the-list"><?php _e('Attach'); ?></a>
                <?php
        }
}
add_filter( 'manage_upload_columns', 'upload_columns' );
add_action( 'manage_media_custom_column' , 'media_custom_columns', 0, 2 );

Zdroj »

Alternativa

Shuffle
http://wordpress.org/…ins/shuffle/

Shuffle modifies/improves your Media Library in a number of ways. Shuffle lets you:

  • Attach an item (Image, Audio, Video) to anything (Post, Page, Custom Post Type, another Attachment)!
  • Reorder an item's attachments using a simple Drag and Drop UI
  • Detach an attachment from an item without deleting the attachment
  • View all attachments attached to an item

This plugin is especially useful if you are using WordPress as a CMS and/or have a media-heavy site.

OVX.cz 2003 | Přihlásit se
Bez cookies už dnes těžko provozovat plnohodnotný web. Setrváním zde tudíž vyjadřujete souhlas s jejich používáním. Více informací. | Zavřít.