Title: Stop Displaying Drafts
Last modified: August 21, 2016

---

# Stop Displaying Drafts

 *  Resolved [kab012345](https://wordpress.org/support/users/kab012345/)
 * (@kab012345)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/stop-displaying-drafts/)
 * I need to figure out where to add **visible=1** so that no drafts are no longer
   being displayed in the widget. Can anyone help with this? I know that it must
   go in the mybbxp-recent-topics-widget.php file, but I cannot figure out the SQL
   code. I have tried editing the following code but I have only been able to produce
   the mybbdb->last_error. Any help on the right code would be very helpful.
 *     ```
       $sql = 'select tid, subject from '
       				. $options['db_prefix'] . 'threads' // sanitized in MyBBXPSettings
       				. ' where fid in( '
       				. $instance['fids'] // sanitized below
       				. ') and visible=1' // <<<<I TRIED THIS>>>
       				. 'order by '
       				. ($instance['define_recent'] == 'created' ? 'dateline' : 'lastpost') // sanitized below and inline
       				. ' desc limit '
       				. $instance['num_topics'] // sanitized below
       				. ';';
       ```
   
 * [http://wordpress.org/extend/plugins/mybb-cross-postalicious/](http://wordpress.org/extend/plugins/mybb-cross-postalicious/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [kab012345](https://wordpress.org/support/users/kab012345/)
 * (@kab012345)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/stop-displaying-drafts/#post-3932714)
 * If anyone is curious, I just figured it out. Here is the code **(Lines 54-63)**
   to PREVENT any drafts from displaying in the recent topics widget.
 *     ```
       $sql = 'select tid, subject from '
       				. $options['db_prefix'] . 'threads' // sanitized in MyBBXPSettings
       				. ' where visible=1'
       				. ' and fid in( '
       				. $instance['fids'] // sanitized below
       				. ') order by '
       				. ($instance['define_recent'] == 'created' ? 'dateline' : 'lastpost') // sanitized below and inline
       				. ' desc limit '
       				. $instance['num_topics'] // sanitized below
       				. ';';
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Stop Displaying Drafts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mybb-cross-postalicious.svg)
 * [MyBB Cross-Postalicious](https://wordpress.org/plugins/mybb-cross-postalicious/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mybb-cross-postalicious/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mybb-cross-postalicious/)
 * [Active Topics](https://wordpress.org/support/plugin/mybb-cross-postalicious/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mybb-cross-postalicious/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mybb-cross-postalicious/reviews/)

## Tags

 * [drafts](https://wordpress.org/support/topic-tag/drafts/)
 * [forum](https://wordpress.org/support/topic-tag/forum/)

 * 1 reply
 * 1 participant
 * Last reply from: [kab012345](https://wordpress.org/support/users/kab012345/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/stop-displaying-drafts/#post-3932714)
 * Status: resolved