We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 387b30f commit a389bceCopy full SHA for a389bce
README.md
@@ -51,6 +51,11 @@ WpApi::post($slug);
51
52
```
53
54
+```php
55
+WpApi::postId($id);
56
+
57
+```
58
59
#### Categories
60
```php
61
WpApi::categories();
src/Threesquared/LaravelWpApi/WpApi.php
@@ -60,6 +60,17 @@ public function pages($page = null)
return $this->get('posts', ['type' => 'page', 'page' => $page]);
}
62
63
+ /**
64
+ * Get post by id
65
+ *
66
+ * @param int $id
67
+ * @return array
68
+ */
69
+ public function postId($id)
70
+ {
71
+ return $this->get("posts/$id");
72
+ }
73
74
/**
75
* Get post by slug
76
*
0 commit comments