Send an e-mail notification to custom user role when a file is uploaded to uploads folder

You could use the wp_mail function https://developer.wordpress.org/reference/functions/wp_mail/ to send an email to anyone after the file is successfully uploaded in your directory. You do not need any action here Add it your code after the file is uploaded successfully if(empty($errors)==true){ move_uploaded_file($file_tmp,”/$user_dirname/”.$document); echo “The file was uploaded successfully!”; wp_mail(..); }else{ print_r($errors); } }

How to allow .bin files upload?

This code would allow you to upload .bin files. /** * Allow upload bin mime type */ add_filter( ‘upload_mimes’, ‘wpse_287673_allow_upload_bin_mime_type’, 1, 1 ); function wpse_287673_allow_upload_bin_mime_type( $mime_types ) { $mime_types[‘bin’] = ‘application/octet-stream’; return $mime_types; } This code is tested and is working for me, but it might be some differences for you since we are allowing … Read more

admin notice on Insert Media popup screen

I’m unaware of any hooks that tap in in the pop up, but there might be. If not, you could use some jQuery to put your message on the pop-up when Add Media is clicked. I was able to with the following: add_action(‘admin_head’,’myplugin_add_media_popup_notice’); function myplugin_add_media_popup_notice() { ?> <script> jQuery(window).load(function() { // the MEDIA buttons you … Read more

Uploaded image with non-english characters is named incorrectly in upload folder

This is well know issue but for some reason it is not resolved since 2013 https://core.trac.wordpress.org/ticket/22363 You can always sanitized filename by yourself using sanitize_file_name filter. /** * Sanitize filename to not brake links with UTF-8 characters * * WordPress allow to upload files with names containing UTF-8 characters. Some * browsers do not handle … Read more

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