post_type ) { return $caps; } } $user_id = is_numeric( $user_id ) ? (int) $user_id : 0; if ( $user_id > 0 && user_can( $user_id, 'edit_others_rooster_courses' ) ) { return $caps; } return array( 'do_not_allow' ); } public static function holds( int $user_id ): bool { return (bool) Settings::get( 'course_premoderation' ) && ! ( $user_id > 0 && user_can( $user_id, 'edit_others_rooster_courses' ) ); } }