$mimes_map `ext => mime-type` map (same shape `get_allowed_mime_types()` returns). * @param int $user_id The current user id. */ $drop_allowed_mimes_map = apply_filters( 'openstation_drop_allowed_mimes', $drop_allowed_mimes_map, get_current_user_id() ); $drop_allowed_mimes_map = is_array( $drop_allowed_mimes_map ) ? $drop_allowed_mimes_map : array(); $drop_allowed_mimes = array_values( array_unique( array_values( $drop_allowed_mimes_map ) ) ); $drop_max_size = (int) wp_max_upload_size(); /** * Filter the per-file size cap (in bytes) used by the OS-file * drop manager. Returning `0` disables the client-side cap — * the server still enforces its own. * * @param int $max_size Default `wp_max_upload_size()`. * @param int $user_id The current user id. */ $drop_max_size = (int) apply_filters( 'openstation_drop_max_size', $drop_max_size, get_current_user_id() ); /** * Filter the master OS-file drop enable gate. Lets plugins * disable the drop manager by role / capability beyond the * default `upload_files` check (e.g. only for admins, or * only on specific multisite blogs). * * @param bool $enabled Default — `current_user_can( 'upload_files' )`. * @param int $user_id The current user id. */ $drop_enabled = (bool) apply_filters( 'openstation_drop_enabled', current_user_can( 'upload_files' ), get_current_user_id() ); $drop_config = array( 'enabled' => $drop_enabled, 'allowedMimes' => $drop_allowed_mimes, 'extToMime' => $drop_allowed_mimes_map, 'maxSize' => $drop_max_size, ); // Lazy-bundle URL builder. Each lazy-loaded bundle (AI Assistant, // About-scene, OS Settings panel, shell-overlays, window-system) // is `