How to upload images in a specific folder using API

The problem is solved. Actually in the regular WordPress API for uploading media wp/v2/media please add one more form data entry rmlFolder: <the_id_of_destination_folder> That is all, it gets uploaded in the correct folder. I am posting my code (in Java based on a library not written by me) After the patch

Format the Layout of Images In The Edit Post Textarea?

Add this to your theme’s functions.php file: add_editor_style(); By default that function will load a file called editor-style.css which is located in the root directory of your theme. The functions accepts a filename or an array of filenames as parameter. Reference in the Codex: http://codex.wordpress.org/Function_Reference/add_editor_style If you want (or need to have) more control over … Read more

How to get default image sizes attribute

If you want to get those set in the admin panel, use the function get_option. The keys are get_option(‘thumbnail_size_w’); get_option(‘thumbnail_size_h’); get_option(‘medium_size_w’); get_option(‘medium_size_h’); get_option(‘large_size_w’); get_option(‘large_size_h’); If you want them for some specific attachment, use wp_get_attachment_image_src

Why no images on a fresh WordPress installation?

I’ve figured it out. I had enabled hotlink protection. I installed the new blog in a new subdomain which was not added to the hotlink protection. So, it prevented the image requests. Now I added to the list and everything’s fine. Silly me. 🙁