wp_editor add media button not working

I will assume that you are creating a custom admin page at ?page=add-quiz, in this case before calling the wp_editor function you also have to enqueue the CSS / Js files for it with the wp_enqueue_media() function. So at the end you should have wp_enqueue_media(); wp_editor( ”, ‘instructions’, $settings = array(‘textarea_name’ => ‘instructions’, ‘textarea_rows’ => … Read more

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]