Add image url column in Media at Wordpress Dashboard
<h1>Add image url column in Media at Wordpress Dashboard, to easy copy image path</h1>
<h2>Copy below code and paste in your theme's <i>function.php</i> file</h2>
function muccolumn( $cols ) {
$cols["mediaurl"] = "URL";
return $cols;
}
function mucvalue( $columnname, $id ) {
if ( $columnname == "mediaurl" ) echo '<input type="text" width="100%" onclick="jQuery(this).select();" value="'. wpgetattachmenturl( $id ). '" />';
}
addfilter( 'managemediacolumns', 'muccolumn' );
addaction( 'managemediacustomcolumn', 'mucvalue', 10, 2 );
</code></pre>
Written by Rajesh Khatri
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Wordpress
Authors
Related Tags
#wordpress
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#