Upload restrictions – upload_mimes – filter: Adding multiple MIMEs for a single extension and adding multiple extensions for a single MIME type?

This filter only accepts strings for mime types. It also already has support for webm, mp4, mpeg, ogv, and ogg. I think you can remove everything except the line for SVGs. A word of warning, WordPress doesn’t support SVG upload by default because it’s a security concern. Be careful about enabling this. At the least, … Read more

What happened to the media manger?

The answer is obvious: no, you can’t. Why? Because there is no folders in database for media attachments, all media files are stored as single row in wp_posts table. I suppose it does not really matter where your media files are stored, it could be your hosting or CDN network, somebody else hosting, etc 🙂 … Read more

How to load attachment in media library for current user?

If you want to filter the attachments only at the moment they are being loaded via AJAX, for example when you are setting the post featured image, you can make use of: function filter_get_the_user_attachments( $query ) { $current_user = wp_get_current_user(); if ( !$current_user ) { return; } $current_user_id = $current_user->ID; $query[‘author__in’] = array( $current_user_id ); … Read more

Proper use of wp_get_attachment_image?

Don’t you need to use get_posts( ‘post_type=attachment’ ) to return the attachment IDs? So, something like: $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘post_status’ => null, ‘post_parent’ => $post->ID ); $attachments = get_posts( $args ); $myimageid = $attachments[0]->ID; wp_get_attachment_image( $myimageid, ‘full’ ); Otherwise, you’re using $post->ID of 1, which isn’t likely to work.

Redirect to another page using contact form 7? [closed]

Redirect to another page using contact form 7? [closed]

Restrict role to view own media

You can restrict users to seeing only their own uploaded media with this piece of code: <?php /* Plugin Name: Manage Your Media Only Version: 0.1 */ //Manage Your Media Only function mymo_parse_query_useronly( $wp_query ) { if ( strpos( $_SERVER[ ‘REQUEST_URI’ ], ‘/wp-admin/upload.php’ ) !== false ) { if ( !current_user_can( ‘level_5’ ) ) { … Read more

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