cannot upload anything into wordpress
i have found the culprit. http-authentication plugin. not sure what it does but it was enabled and ticked as active, so i just unticked it.
i have found the culprit. http-authentication plugin. not sure what it does but it was enabled and ticked as active, so i just unticked it.
You can try with this: function remove_media_tabs($strings) { unset($strings[“insertFromUrlTitle”]); unset($strings[“setFeaturedImageTitle”]); unset($strings[“createGalleryTitle”]); unset($strings[“uploadFilesTitle”]); return $strings; } add_filter(‘media_view_strings’,’remove_media_tabs’); This will remove ‘Upload file’ and ‘Insert from URL’ links when you open insert media screen, so user will be able only to select images or whatever that is already in media library. For more things you can do … Read more
I am working on a similar functionality. I want BuddyPress users to upload image, make a custom post and set the uploaded image as the post’s featured image. It is possible to do this, do not see why not. Maybe somebody will be able to post a complete out-of-box solution for you. In the meantime, … Read more
I solved this by simulating a $_FILES array: $file_array = array( ‘name’ => basename( $file_path ), ‘type’ => $url_type, ‘tmp_name’ => $file_path, ‘error’ => 0, ‘size’ => filesize( $file_path ) ); And then $att_id = media_handle_sideload( $file_array, $post_id ); As simple as this..
Have you had a look at is_user_logged_in()? If you can explain how you’re serving the photos I can perhaps suggest a way to authorize some images to be shown and the rest hidden to only logged in users.
For trivia WP will generate all registered sizes for every image natively. While this doesn’t quite seem optimal, the recommendation (if one might call it that) to deal with it is “get bigger disks”. 🙂 If size isn’t a concern you can just go with it. The typical solution takes a little different angle. Instead … Read more
WP is reasonably secure for default use cases. In typical workflow it will call wp_check_filetype_and_ext() to verify that file uploaded is of allowed type. It can get considerably more questionable in regards to security if you customize it to work with non–default kinds of files and you might need to implement your own security checks. … Read more
Solved it! It was an issue with the Polylang plugin stopping the image from showing, I’m not quite sure why but adding a row to the wp_term_relationships table, where the object_id is the id of the attachment, and the term_taxonomy_id is the id of the language definition in the wp_term_taxonomy table fixed the issue.
If you have a lot of uploads, using the /year/month/day/ approach is recommended in order to keep the number of files in each directory manageable. (Just today I ran into an issue where there were more files in the uploads folder [~12,000] than the FTP server was configured to include in a directory listing [~10,000]. … Read more
How to switch to year/month directory structure format from a single folder