Support » Plugin: Search Regex » Adding support for custom posts

  • The search includes all post types, except when searching by post content, in which case it only considers pages and posts.

    In order to make search by post content work with all post types, change line 7 of searches/post_content.php

    from
    $sql = "SELECT ID, post_content, post_title FROM {$wpdb->posts} WHERE post_status != 'inherit' AND post_type IN ('post','page') ORDER BY ID ".$orderby;

    to
    $sql = "SELECT ID, post_content, post_title FROM {$wpdb->posts} WHERE post_status != 'inherit' ORDER BY ID ".$orderby;

  • The topic ‘Adding support for custom posts’ is closed to new replies.