Stylesheet being loaded outside of

The two stylesheets is only loaded when a video or sound was included in a post or page and that happens after wp_head. But do not despair! There is a filter you can use! in the code it looks like this: apply_filters( ‘style_loader_tag’, “<link rel=”$rel” id=’$handle-css’ $title href=”https://wordpress.stackexchange.com/questions/115412/$href” type=”text/css” media=”$media” />\n”, $handle ); so i … Read more

Adding .mov files (not from YouTube) [duplicate]

You can use upload_mimes filter and add mime for .mov files (video/quicktime). add_filter( ‘upload_mimes’, ‘customizeMimeTypes’, 10, 1 ); function customizeMimeTypes( $mimeTypes) { $mimeTypes[‘mov’] = ‘video/quicktime’; return $mimeTypes; } If you want to embed video with media library you can use wp_video_extensions filter. add_filter( ‘wp_video_extensions’, ‘addMovToWPVideo’); function addMovToWPVideo( $extensions ) { $extensions [] = ‘mov’; return … Read more

Admin edit S3 Media file?

1) Use persistent storage that can be shared among all EC2 instances within a region – Amazon Elastic File System OR 2) Give developers access to the AWS console or AWS Command Line Interface to access S3 resources. In addition use AWS Identity and Access Management to limit access; whether it is read-only or read/write. … Read more

Importing existing s3 Media into WP

In theory you’d think it could work like that. In reality, it doesn’t. There’s a simple reason no plugin exists that would do this. Whenever you import media into WordPress, it creates thumbnail files of various sizes, (even for videos). In order to create those thumbnails, it has to download (you guessed it) the entire … Read more

How to disable (and hide) the Media Library for certain users?

I did a googles of the issue (using ‘wordpress restrict media access’) and got this link on the first page https://www.wpbeginner.com/plugins/how-to-restrict-media-library-access-to-users-own-uploads-in-wordpress/ Which has this code // Limit media library access add_filter( ‘ajax_query_attachments_args’, ‘wpb_show_current_user_attachments’ ); function wpb_show_current_user_attachments( $query ) { $user_id = get_current_user_id(); if ( $user_id && !current_user_can(‘activate_plugins’) && !current_user_can(‘edit_others_posts ‘) ) { $query[‘author’] = $user_id; … Read more

core/gallery get figcaption text

You’re right…the figcaptions are encoded as html in $block[‘innerHTML’]. You could do sth. like $tmpArray = explode(‘</li>’,$block[‘innerHTML’]); before your foreach loop to split the HTML string into an array that matches your gallery items and inside the loop strip_tags($tmpArray[i]); to strip away all html tags and only get the text string inside <figcaption></figcaption>. You’ll only … Read more

How to disable Media Library?

I did a googles of the issue (using ‘wordpress restrict media access’) and got this link on the first page https://www.wpbeginner.com/plugins/how-to-restrict-media-library-access-to-users-own-uploads-in-wordpress/ Which has this code // Limit media library access add_filter( ‘ajax_query_attachments_args’, ‘wpb_show_current_user_attachments’ ); function wpb_show_current_user_attachments( $query ) { $user_id = get_current_user_id(); if ( $user_id && !current_user_can(‘activate_plugins’) && !current_user_can(‘edit_others_posts ‘) ) { $query[‘author’] = $user_id; … Read more

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