WordPress.org

Support

Support » Plugins and Hacks » Search Everything » [Resolved] Exclude post_mime_type_image

[Resolved] Exclude post_mime_type_image

Viewing 2 replies - 1 through 2 (of 2 total)
  • It seems I have found it in the function se_search_attachments :

    function se_search_attachments( $where ) {
    		global $wpdb;
    		if ( !empty( $this->query_instance->query_vars['s'] ) ) {
    
    			$where = str_replace( '"', '\'', $where );
    			if ( !$this->wp_ver28 ) {
    				$where = str_replace( " AND (post_status = 'publish'", " AND (post_status = 'publish' OR post_type != 'attachment'", $where );
    				$where = str_replace( "AND post_type != 'attachment'", "", $where );
    			}
    			else {
    				$where = str_replace( " AND ($wpdb->posts.post_status = 'publish'",  " AND ($wpdb->posts.post_status = 'publish' <strong>OR $wpdb->posts.post_mime_type = 'application/pdf' OR $wpdb->posts.post_mime_type = 'application/msword'</strong> ", $where );
    				$where = str_replace( "AND $wpdb->posts.post_type != 'attachment'", "", $where );
    			}
    		}
    		$this->se_log( "attachments where: ".$where );
    		return $where;
    	}

    it would be so great to have an option like “Include/Exclude post_mime pdf or word or image ” instead of me manually editing it

    Hope you don’t mind, but since this topic is now older than 2 months, we are going to mark it as ‘resolved’.

    If you find yourself with any other questions or if there’s anything that’s not completely clear, do let us know, since we’ll gladly help!

    Take care & have a nice day!

    Best,
    Silvo

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Exclude post_mime_type_image’ is closed to new replies.
Skip to toolbar