Small Extension for the Media-Library


Small changes can sometimes work wonders. 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. Further information can be found in this post.

A similar solution is the Plugin Post2Media, which provides a link within the Thickbox to the attachments.
The following code should be used as a Plugin; alternative you can use the functions.php of your theme.

medialibrary3

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);
		?>
		
			
		, 
		


Posted

in

by

Comments

5 responses to “Small Extension for the Media-Library”

  1. Philipp Avatar
    Philipp

    Halleluja! Danke!!! Gerade bei Seiten mit WPML ist das immer die Hölle gewesen.

  2. Philipp Avatar
    Philipp

    Okay, sorry. Ich verstehe es nicht ganz: Es soll doch möglich sein, eine 1:n Verknüpfung zwischen Bildern und Posts / Seiten zu erstellen, oder? Bei mir in der Mediathek wird der Reattach – Button nicht angezeigt. Strange.

  3. Frank Avatar

    eine 1:n bekommst du mit dem Plugin Post2Media, welches dort genannt ist.

  4. Rhonda Klenk Avatar

    I really like what you blog about here,very insightful and intelligent. One thing though, I’m running Chrome in Fedora and parts of your site structure are a little off. I realize it really is not really the typical setup, however it is always a thing to keep an eye on. I hope this helps and keep up the quality publishing.

    http://thebestwordpressplugins.com