Code
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
<?php | |
function muc_column( $cols ) { | |
$cols["media_url"] = "URL"; | |
return $cols; | |
} | |
function muc_value( $column_name, $id ) { | |
if ( $column_name == "media_url" ) echo '<input type="text" width="100%" onclick="jQuery(this).select();" value="'. wp_get_attachment_url( $id ). '" />'; | |
} | |
add_filter( 'manage_media_columns', 'muc_column' ); | |
add_action( 'manage_media_custom_column', 'muc_value', 10, 2 ); | |
?> |
Screen shot
Note
Description | メディアライブラリの画像一覧のテーブルの列にURLの項目を加え、コピーしやすくする |
---|---|
WordPress Ver. | 3.3.1 |
Via | Media library URL column for easy copy and paste |