Get Specific Files (Only Specific Extension Type All Files in Loop ) from Media

You don’t need to use strpos() to figure out the extension because you’ve already parsed the URL above and stored the extension in $AllAtachmentURLextension, so all you need to do is //for Specific Extensions if( ‘docx’ == $AllAttachmentURLextension ) { // docx handling here } elseif ( ‘pdf’ == $AllAttachmentURLextension ) { // pdf handling … Read more

Media manager asks for file title when upload

Line 4139 of post.php in WP 6.2 branch has the error message, Content, title, and excerpt are empty.. Reviewing the previous lines of code, it should be excluded for attachments, but there may be a callback applied to the wp_insert_post_empty_content filter which is requiring attachments to also have content, title, and excerpt. Use Query Monitor … Read more

Get a list of folders inside uploads directory

The closest is the WP Filesystem API, but that’s mainly intended for compatibility purposes, e.g. to enable files to be written when the only access is via FTP and direct filesystem write access is unavailable. Particularly: https://developer.wordpress.org/reference/classes/wp_filesystem_base/dirlist/ However, if you are not distributing this code and only using it for yourself or known environments, you … Read more

stop resize button for wordpress media

That’s a bit tricky because WordPress doesn’t offer this functionality out of the box. But a workaround would be to stop WordPress from generating additional image sizes for uploaded images. But it will apply to all image uploads, not just those in the WooCommerce product gallery. If you wanted to try it out, here’s the … Read more

I want to allow certain file types on dokan upload files

You can try allowing mimes yourself, like this : add_filter(‘upload_mimes’, ‘custom_upload_mimes’); function custom_upload_mimes($existing_mimes) { $existing_mimes[‘rbxlx’] = ‘text/xml’; $existing_mimes[‘rbxlm’] = ‘text/xml’; $existing_mimes[‘rbxl’] = ‘text/xml’; return $existing_mimes; } If this doesn’t help, you need to look outside WP – it’s possible the server itself won’t allow those uploads. Can you access the .htaccess ? If so, you … Read more

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