Support » Plugin: Edit Flow » Hide status post

  • Hi

    I need to hide two specific status of post (‘draft’, ‘pending’) for a specific role (

    Enter your site to track your reference, but it does not work.

    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
     * @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(
                // 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] );
        return $custom_statuses;
    add_filter( 'ef_custom_status_list', 'efx_limit_custom_statuses_by_role' );

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author cojennin


    Hrm. You’re still seeing the statuses with this code enabled?

    Javier Moreno


    Yes. You know how to hide it? could you help me please?

    Plugin Author cojennin


    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.