Handle image file and save it to media

What I did was to get media folder and save there the cropped image. After that update meta data: $imageToCropPath= get_attached_file($attachmentId); // Get file path to the image that will be cropped $img = imageCreateFromJpeg($imageToCropPath); $croppedImage = imagecrop($img, [‘x’ => $cropX, ‘y’ => $cropY, ‘width’ => $cropWidth, ‘height’ => $cropHeight]); $uniqueId = md5(uniqid()); // Create … Read more

Change thumbnail size for Media Library

This was an interesting question as I knew nothing about modifying the default behaviour of the Media Library. So, I ended up doing some research on the matter. I found out that the Media Library uses wp_ajax_query_attachments() to get the images and other media. Inside the ajax function there’s ajax_query_attachments_args that can be used to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)