Automatically assign video ‘poster’ value to ‘filename’ for archive listing

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

Restrict WordPress Media Library for a specific user role (users can only see/select own media)

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 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

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