Skip to content

Commit

Permalink
Merge pull request #47 from GarvMaggu/master
Browse files Browse the repository at this point in the history
Added instructions to upload Media on WordPress using uploadMedia function
  • Loading branch information
SachinGanesh authored Jun 24, 2020
2 parents 126ef9a + 636fdf0 commit bea820a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,19 @@ Future<void> deleteComment({@required int id}) async {
}
```

### 16. Upload Media

```dart
uploadMedia(File image) async {
var media = await wordPress.uploadMedia(image).then((m) {
print('Media uploaded successfully: $m');
}).catchError((err) {
print('Failed to upload Media: $err');
});
int mediaID = media['id'];
}
```

## Future Work

1. Implementing OAuth 2.0 authentication.
Expand All @@ -281,3 +294,4 @@ Future<void> deleteComment({@required int id}) async {
- [Sachin Ganesh](https://github.com/SachinGanesh)
- [Harm-Jan Roskam](https://github.com/harmjanr)
- [Yahya Makarim](https://github.com/ymakarim)
- [Garv Maggu](https://github.com/GarvMaggu)

0 comments on commit bea820a

Please sign in to comment.