Failed media import
I solved the problem… my source blog was private i.e. required password… I made it public for couple of minutes, and importer plugin did it’s job properly!
I solved the problem… my source blog was private i.e. required password… I made it public for couple of minutes, and importer plugin did it’s job properly!
Pretty sure this is being caused by the Smush.it Plugin. Apparently their servers can’t handle the traffic lately.
You probably need to allow the mime types for them to be allowed to upload. https://www.robertwent.com/blog/adding-custom-mime-types-for-wordpress-uploads/ //The following goes in a themes functions file or a custom hooks plugin function so_387865_custom_upload_mimes ( $existing_mimes ) { $existing_mimes[‘epub’] = ‘application/epub+zip’; $existing_mimes[‘mobi’] = ‘application/x-mobipocket-ebook’; return $existing_mimes; } add_filter(‘upload_mimes’, ‘so_387865_custom_upload_mimes’);
Yes it is unsafe, though not for the reasons you think. DO NOT DO THIS. If your developers can upload a PHP file to your site that gets executed, then that PHP file can undo all other security measures that you put in place. The location of the file is irrelevant. Functionally, there is no … Read more
I have it working now, I had tried this code below before posting this question but I was missing the Post ID to assign it to so I just realized that and fixed it and it does work now! Here is the code just in case it helps someone else in the future… $photo_name=”testimagename”; $newId … Read more
You will need to get the images onto your server and into the library. From that point you will be able to attach them to the post. You can only have 1 featured image so this needs to be adjusted to set the featured once but still download all the images and attach them to … Read more
If all you want to do is to have a “cdn” type url, the easiest solution that do not require any programing is to make HostPath/project.dev/cdn a symlink to project.dev/wp-content/uploads. This way for theOS both paths are essentially the same. This should be easy to do if you are in full control of the server … Read more
There is an error in your src; <img src=”http://example.com//wp-admin/admin-ajax.php?action=random_banner”> Try this one: <img src=”http://example.com/wp-admin/admin-ajax.php?action=random_banner”> or <img src=”https://wordpress.stackexchange.com/questions/215158/<?php echo admin_url(“admin-ajax.php?action=random_banner’ ); ?>”> You can also use a query to get a random image. AJAX add_action( ‘wp_ajax_random_banner’, ‘random_banner’ ); add_action( ‘wp_ajax_nopriv_random_banner’, ‘random_banner’ ); function random_banner() { // search for 1 random image $image_ids = get_posts( array( ‘post_type’ … Read more
Apparently there’s an upload_size_limit filter in WordPress. To check what your site’s upload limit is set to, add this to your theme’s functions.php: add_action( ‘shutdown’, ‘wpse115322_upload_sizes’, 99 ); function wpse115322_upload_sizes() { $size = wp_max_upload_size(); $kb = $size/1024; $mb = $size/(1024*1024); echo( “$kb KB / $mb MB<br />\n” ); } That’ll print your site’s actual max … Read more
Supposing that I’m interpreting your Question correctly… The thumbnails displayed in the new Media Uploader are already the medium sized ones, being constrained on the fly. So, it’s a matter of applying some CSS styling to increase their size. Maybe other style adjustments are necessary, this is just a proof of concept. add_action( ‘admin_head-post-new.php’, ‘style_thumbnails_wpse_81677’ … Read more