Automatically set Featured Image

Install plugin: ” Auto Upload Images

Create a new POST.

Put a remote url image inside the POST, click Publish, then click UPDATE, then this image is automatically uploaded into the Media, and by clicking UPDATE, this image is also set as the Featured Image.

NOTe: There are two images loaded into Media, one is the small thumbnail, another is original size image.

BUT: there is another small problem with solution:
If you want to change the featured image, by using another remote image in the POST, then click UPDATE, you will NOT see the new image as the new featured image, BUT, the new image is well uploaded into the Media, so you can well do Replace Featured Image, then pick out the newly uploaded image, it works fast too.

You can resize and edit an image, and copy the image and paste into the POST, then Update, it will become the Featured Image. !!! Cool.

BUT: Another Big Problem:
I will upload ALL images in the POST into Media Library, but I only want the FIRST image to be uploaded and set as Featured Image.


OKAY, problem can be solved. Modify the
public function save($postarr)
— add the break statement.

    foreach (array_unique($urls) as $index => $url) {
        $unique_array[] = $images[$index];
        //WAUTOM: CHANGE: now, I only output the FIRST image. So NOT all images in the POST will be uploaded to media library.

OKAY: Final solution:
I created a new plugin called:
Auto Upload Images WAUTOM


Leave a Reply

Please Login to comment
1 Comment threads
0 Thread replies
Most reacted comment
Hottest comment thread
1 Comment authors
HanTang Recent comment authors
Notify of