Wednesday 8 May 2013

Replace Existing Images In WordPress Media Library

Important: All scripts hosted on widcraft.googlecode.com don't work anymore because Google has blocked that SVN repository.

You ever tried to replace an existing image from your WordPress. It sucks and takes a lot of time to delete, rename, replace, and upload your images from your file manager. Let's make it easier than ever.

A guy called "mungobbq" created a great plugin, which gives us an option to replace any uploaded file from the media "edit" view.

You can download this plugin at this link, or by searching "Enable Media Replace" on your blog's plugin directory. Below is a (huge) quote from this plugin's official page:

It's simple to replace a file

  1. Just replace the file. This option requires you to upload a file of the same type as the one you are replacing. The name of the attachment will stay the same no matter what the file you upload is called.
  2. Replace the file, use new file name and update all links. If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file will be updated to point to the new file name.
This plugin is very powerful and a must-have for any larger sites built with WordPress.

Display file modification time

There is a shortcode available which picks up the file modification date and displays it in a post or a page. The code is:

[file_modified id=XX format=XXXX]
 
where the "id" is required and the "format" is optional and defaults to your current WordPress settings for date and time format.

So [file_modified id=870] would display the last time the file with ID 870 was updated on your site. To get the ID for a file, check the URL when editing a file in the media library (see screenshot #3)
If you want more control over the format used to display the time, you can use the format option, so [file_modified id=870 format=Y-m-d] would display the file modification date but not the time. The format string uses standard PHP date() formatting tags.
Important: Check our new website TricksPanda.com for WordPress tutorials, plugins and more.
 
Powered by Blogger.