'positive Ganzzahl erwartet']); } $attachment = get_post($attachmentId); if (! $attachment instanceof WP_Post || $attachment->post_type !== 'attachment') { return Errors::notFound( sprintf('Medium %d nicht gefunden.', $attachmentId), 'ID prüfen; Medien über lit/media-search (direkt: lit-media-search) suchen.' ); } if (! current_user_can($capability, $attachmentId)) { return Errors::forbidden(sprintf('Keine Berechtigung für Medium %d.', $attachmentId)); } if (! $allowTrashed && $attachment->post_status === 'trash') { return Errors::invalidInput( sprintf('Medium %d liegt im Papierkorb.', $attachmentId), ['id' => 'Medium liegt im Papierkorb'], 'Medium zuerst in der WordPress-Mediathek wiederherstellen.' ); } return $attachment; } }