New answers tagged

0

Here is Media Deduper plugin. Media Deduper will find and eliminate duplicate images and attachments from your WordPress media library.


0

You can checkout this link https://codex.wordpress.org/Javascript_Reference/wp.media jQuery(function($){ // Set all variables to be used in scope var frame, metaBox = $('#meta-box-id.postbox'), // Your meta box id here addImgLink = metaBox.find('.upload-custom-img'), delImgLink = metaBox.find( '.delete-custom-img'), imgContainer ...


0

Got it working!! :) Final Code: function wpse156319_posts_where( $where, $query ) { global $wpdb; $currentID = $_POST['post_id']; //shows 2069 $post = get_post($currentID); //shows 2068 $parentID = $post->post_parent; $chargs = array('post_parent' => $post->ID, 'post_type' => 'projects' ); $children = get_children($...


0

You need to alter the query using posts_where and posts_join filters. function restrict_media_images_per_post_type($query) { add_filter('posts_where', 'media_posts_where'); add_filter('posts_join', 'media_posts_join'); return $query; } add_filter('ajax_query_attachments_args', 'restrict_media_images_per_post_type'); Change "WHERE" clause to ...


Top 50 recent answers are included