-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10bf01f
commit b5dd749
Showing
3 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/* | ||
Plugin Name: Media URL Column | ||
Plugin Description: Adds URL column to the Media list page with autoselect. | ||
*/ | ||
|
||
|
||
add_filter( 'manage_media_columns', 'muc_column' ); | ||
add_action( 'manage_media_custom_column', 'muc_value', 10, 2 ); | ||
|
||
function muc_column( $cols ) { | ||
$cols['media_url'] = "URL"; | ||
return $cols; | ||
} | ||
|
||
function muc_value( $column_name, $id ) { | ||
if ( 'media_url' === $column_name ) | ||
printf( '<input class="media-url-input nameless-input" style="width:100%%" type="text" readonly="" onclick="%s" value="%s" />', | ||
'jQuery(this).select();', | ||
wp_get_attachment_url( $id ) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters