Display attachments by the ID of the post being edited in the wp.media frame (frontend)
Display attachments by the ID of the post being edited in the wp.media frame (frontend)
Display attachments by the ID of the post being edited in the wp.media frame (frontend)
That’s default Core behavior for the Author role. Authors can only edit and publish their own content – they can’t edit others’. Here are all the capabilities of Authors – you’ll notice that ‘edit_others_posts’ is not in the list of capabilities. A few ways you can accomplish your goal are: Use, or create, a user … Read more
WordPress auto generates small medium and large of an image on upload, how can we guess their links?
Thanks for your help. Managed to figure out a temporary solution, should anyone else have a similar query. Temporarily edited media.php $filename = basename( wp_get_attachment_url( $attachment_id ) ); $default_types = wp_get_video_extensions(); $defaults_atts = array( ‘src’ => ”, ‘poster’ => “diary/wp-content/Pictures/posters/”.$filename.”.jpg'”, ‘loop’ => ”, ‘autoplay’ => ”, ‘preload’ => ‘none’, ‘width’ => 640, ‘height’ => 360, … Read more
add this to your functions.php or in a snippet, with this code the users with role external will only see their own uploads, any other role will see them all just has before. add_filter( ‘ajax_query_attachments_args’, ‘role_external’ ); function role_external( $query ) { $user_id = get_current_user_id(); if ( $user_id && current_user_can(‘external’) ) { $query[‘author’] = $user_id; … Read more
How to enable sorting in custom media uploader in plugin
AJAX – save an $_FILES picture in media library
Media Library Grid View Custom Filter
Insert woocommerce products programmatically with featured image and gallery
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