MP4 file links download instead of playing

I suggest you to make updates on your web-server instead of WordPress. You can set mime type for mp4 files to application/octet-stream. Using .htaccess (Apache): AddType application/octet-stream .mp4 For nginx check documentation If you need to change mp4 mime type on upload, you can use this hook: add_filter(‘upload_mimes’, ‘wpse_320375_remove_mime_types’); function wpse_320375_remove_mime_types($mimes){ $mimes[‘mp4’] = ‘application/octet-stream’; }

Adding attachment custom field metadata to TinyMCE tag

Currently I’ve achieved a somewhat acceptable solution by using the do_shortcode_tag filter as mentioned in this answer, and using get_post_meta to fetch the value, as mentioned in this answer. There are (at least!) two caveats, however: The id in do_shortcode_tag‘s $attr isn’t the attachment post ID, but rather the CSS id from the original shortcode. … Read more

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

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