WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Search Everything] Not Searching Attachments

[Plugin: Search Everything] Not Searching Attachments

Viewing 4 replies - 1 through 4 (of 4 total)
  • wrenchpilot
    Member

    @wrenchpilot

    Apparently attachments now default to a ‘post_status’ of ‘inherit’

    Fixed by changing line 358 to:
    $where = str_replace(" AND (post_status = 'publish'", " AND (post_status = 'publish' OR post_status = 'attachment' OR wp_posts.post_status = 'inherit'", $where);

    And line 363 to:
    $where = str_replace(" AND ($wpdb->posts.post_status = 'publish'", " AND ($wpdb->posts.post_status = 'publish' OR $wpdb->posts.post_status = 'attachment' OR $wpdb->posts.post_status = 'inherit'", $where);

    thanks for this. super helpful!

    Workshopshed
    Member

    @workshopshed

    I also found this issue, my change was similar but I swapped the search criteria of post_status = ‘attachment’ with post_type = ‘attachment’

    I tried amending the lines 397 and following as follows, but it still does not work I am afraid:

    $where = str_replace(" AND (post_status = 'publish'", " AND (post_status = 'publish' OR post_type = 'attachment' OR post_status = 'inherit'", $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' OR $wpdb->posts.post_type = 'attachment' OR $wpdb->posts.post_status = 'inherit'", $where);

    Any leads appreciated.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Search Everything] Not Searching Attachments’ is closed to new replies.