wp.media multiple selection limit

As far as I know, that feature is not officially supported, so there is no easy way to achieve it. But if you must, then it can be made possible by extending the wp.media.model.Selection.prototype.add function which is used to add new items to the selection list. Working example: (tried & tested with WordPress v6.2.2) ( … Read more

How do I display a PDF thumbnail as a link to the PDF without uploading the image

The PDF images created by wordpress are stored within the PDF attachment object metadata. [ { “id”: 121, “media_type”: “file”, “mime_type”: “application/pdf”, … “media_details”: { “sizes”: { “full”: { … “source_url”: “<domain>/wp-content/uploads/document-name-pdf.jpg” } } ] Extracting the image from the PDF Adding an image block or adding a featured image to a post requires an … Read more

Getting fatal error when using manage_media_columns filter of WordPress

It looks like the issue is coming because of the conflict of the hooks (manage_media_columns and manage_{$screen->id}_columns) because when we manage_{$screen->id}_columns used for media it becomes manage_media_columns and started conflicting. The same details are mentioned in the documentation link of the hook. Link: https://developer.wordpress.org/reference/hooks/manage_screen-id_columns/#more-information

Uploading images via ACF update_field function

Should anyone come across the same issue, I found that when creating the $gallery_data array I was creating an array of arrays instead of key value pairs, I ended up just running the update_field function inside a foreach with the add_image key value pair created. $gallery_img_id = rudr_upload_file_by_url($gallery_img[“original_path”]); $acf_gallery_slug = “gallery_image_” . $counter; $add_image = … Read more

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