Title: MarkArts's Replies | WordPress.org

---

# MarkArts

  [  ](https://wordpress.org/support/users/markarts/)

 *   [Profile](https://wordpress.org/support/users/markarts/)
 *   [Topics Started](https://wordpress.org/support/users/markarts/topics/)
 *   [Replies Created](https://wordpress.org/support/users/markarts/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/markarts/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/markarts/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/markarts/engagements/)
 *   [Favorites](https://wordpress.org/support/users/markarts/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Search by My Solr Server] Trash Items Still In Solr Index](https://wordpress.org/support/topic/trash-items-still-in-solr-index/)
 *  [MarkArts](https://wordpress.org/support/users/markarts/)
 * (@markarts)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/trash-items-still-in-solr-index/#post-4057863)
 * I had the same problem and after some digging I found out why this was happening.
 * First of the plugin doesn’t have a hook for “transition_post_status”.
 * And secondly the hook on “save_post” doesn’t contain a check for the trashed,
   private or protected status (only for draft and auto-draft) causing trashed, 
   private and protected items to be put (back) in the index when saved.
 * To solve this problem you can either overwrite the hooks in your own functions.
   php or change the following lines in the advanced-search-by-my-solr-server.php
   file from the plugin
 * Line 598
    `if ($post_info->post_status=='auto-draft' || $post_info->post_status
   =='draft') return;` To `if ($post_info->post_status=='auto-draft' || $post_info-
   >post_status=='draft' || $post_info->post_status=='private' || $post_info->post_status
   =='protected' || $post_info->post_status=='trash' ) return;`
 * Line 638
    `if ( ($_POST['prev_status'] == 'publish' || $_POST['original_post_status']
   == 'publish') && ($post_info->post_status == 'draft' || $post_info->post_status
   == 'private') ) {` To `if ( ($_POST['prev_status'] == 'publish' || $_POST['original_post_status']
   == 'publish') && ($post_info->post_status=='draft' || $post_info->post_status
   =='private' || $post_info->post_status=='protected' || $post_info->post_status
   =='trash' ) ) {`
 * And add this line to the bottom of the file
    `add_action( 'transition_post_status','
   mss_handle_status_change');`
 * If you don’t want to change the plugin files you can also ‘overwrite’ the hooks
   for “transition_post_status” and “save_post” by copying the original functions
   
   You will need to add `require_once(ABSPATH."wp-content/plugins/advanced-search-
   by-my-solr-server/advanced-search-by-my-solr-server.php");` in your function 
   to make sure you can use the plugin functions.

Viewing 1 replies (of 1 total)