Title: Hide status post
Last modified: August 31, 2016

---

# Hide status post

 *  [Javier Moreno](https://wordpress.org/support/users/morenojavier/)
 * (@morenojavier)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/hide-status-post/)
 * Hi
 * I need to hide two specific status of post (‘draft’, ‘pending’) for a specific
   role ([http://prntscr.com/ae0cdu](http://prntscr.com/ae0cdu)).
 * Enter your site to track your reference, but it does not work.
 * [http://editflow.org/extend/limit-custom-statuses-based-on-user-role/](http://editflow.org/extend/limit-custom-statuses-based-on-user-role/)
 * I added the following code, but I think it does not work.
 * Could you please help me!
 *     ```
       /**
        * Limit custom statuses based on user role
        * In this example, we limit the statuses available to the
        * 'contributor' user role
        *
        * @see http://editflow.org/extend/limit-custom-statuses-based-on-user-role/
        *
        * @param array $custom_statuses The existing custom status objects
        * @return array $custom_statuses Our possibly modified set of custom statuses
        */
       function efx_limit_custom_statuses_by_role( $custom_statuses ) {
   
           $current_user = wp_get_current_user();
           switch( $current_user->roles[0] ) {
               // Only allow a contributor to access specific statuses from the dropdown
               case 'contribuidor':
                   $permitted_statuses = array(
                           'sinopsis_rechazada',
                           'sinopsis-solicitud',
                           'aprob-sinop',
                           'rev-contenido-editor',
                           'rev_contenido_contr',
                       );
                   // Remove the custom status if it's not whitelisted
                   foreach( $custom_statuses as $key => $custom_status ) {
                       if ( !in_array( $custom_status->slug, $permitted_statuses ) )
                           unset( $custom_statuses[$key] );
                   }
                   break;
           }
           return $custom_statuses;
       }
       add_filter( 'ef_custom_status_list', 'efx_limit_custom_statuses_by_role' );
       ```
   
 * [https://wordpress.org/plugins/edit-flow/](https://wordpress.org/plugins/edit-flow/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [cojennin](https://wordpress.org/support/users/comradefuzz/)
 * (@comradefuzz)
 * [10 years ago](https://wordpress.org/support/topic/hide-status-post/#post-7163383)
 * Hrm. You’re still seeing the statuses with this code enabled?
 *  Thread Starter [Javier Moreno](https://wordpress.org/support/users/morenojavier/)
 * (@morenojavier)
 * [10 years ago](https://wordpress.org/support/topic/hide-status-post/#post-7163384)
 * Yes. You know how to hide it? could you help me please?
 *  [cojennin](https://wordpress.org/support/users/comradefuzz/)
 * (@comradefuzz)
 * [10 years ago](https://wordpress.org/support/topic/hide-status-post/#post-7163385)
 * Is the value of `$current_user->roles[0]` definitely `contribuidor`? That could
   be one reason. It may need to be `contributor`.
 * edit: spelling

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Hide status post’ is closed to new replies.

 * ![](https://ps.w.org/edit-flow/assets/icon-256x256.png?rev=3433533)
 * [Edit Flow](https://wordpress.org/plugins/edit-flow/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/edit-flow/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/edit-flow/)
 * [Active Topics](https://wordpress.org/support/plugin/edit-flow/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/edit-flow/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/edit-flow/reviews/)

## Tags

 * [editflow](https://wordpress.org/support/topic-tag/editflow/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [status](https://wordpress.org/support/topic-tag/status/)

 * 3 replies
 * 2 participants
 * Last reply from: [cojennin](https://wordpress.org/support/users/comradefuzz/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/hide-status-post/#post-7163385)
 * Status: not resolved