How to do it...

  1. Navigate to the WordPress plugin directory of your development installation.
  2. Navigate to the ch8-bug-tracker directory and edit ch8-bug-tracker.php.
  3. Locate the ch8bt_shortcode_list function and find the section where the SQL query is being prepared.
  4. Add an extra line to the query (the highlighted line of code in the following code block) to show only open bugs (bugs with a bug_status field set to 0):
$bug_query = 'select * from ' . $wpdb->get_blog_prefix(); $bug_query .= 'ch8_bug_data '; $bug_query .= 'where bug_status = 0 '; 
  1. Make the change highlighted in the following code to the code building the search query:
if ( $search_mode ) {     $search_term = '%' . $search_string . '%';     $bug_query .= "and ( bug_title like '%s' ...

Get WordPress Plugin Development Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.