Add Custom Column To Media Page
How do you get full image URL in Media Library? I bet you will go through this step:
- Go to Media » Library
- On Media Library list, click file name.
- Form Edit Media appeared. Select File URL and use it.
For single image operation, this should be enough. But, if you did have a lot of pictures, this operation would be very annoying. For this, I have a simple solution. With a few lines of code that later summarized into a plugin. Then you will have a way to access the images directly from the Media Library.
For these needs, we need to implement 2 filters,
manage_media_custom_column. Here is his code:
Save it with file name ‘
direct_image_url_access_from_media_list.php‘. But, before saving it to the
/wp-content/plugins/, do not forget to add ‘file header‘. This is mandatory, if not, the plugin will not be recognized by wordpress. This is an example, please be creative:
/* Plugin Name: Been Seen Manager Description: Exclusive plugin for beenseen Version: 0.1 Author: Arief Bayu Purwanto Author URI: http://bayu.freelancer.web.id/ */
Oh, ‘file header’ MUST be placed early in the script. Can’t follow this tutorial? don’t worry, I’ve prepared the files that’s already done so you can upload directly to server.
Let’s see how this plugin in action. Figure One is Media Library before the plugin is active and the second one is Media Library after the plugin is active. See the difference?