Skip to content

Commit 11a5f6f

Browse files
Merge pull request #79 from QuickDevelopment/feat-(update-docs)
Another two fixes
2 parents cbbad36 + e7a0b8b commit 11a5f6f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

docs/classes/Post.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h4>Example</h4><pre><code class="language-ts"><span class="hl-3">import</span><
2525
</div><aside class="tsd-sources"><ul><li>Defined in Api/Post.ts:94</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="bySearchTerm" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>by<wbr/>Search<wbr/>Term</span><a href="#bySearchTerm" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="bySearchTerm.bySearchTerm-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">by<wbr/>Search<wbr/>Term</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">searchTerm</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#bySearchTerm.bySearchTerm-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Set the searchTerm.</p>
2626
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">searchTerm</span>: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>2.0.0</p>
2727
<h4>Description</h4><p>This will set the searchTerm. This is useful if you want to get posts from different searchTerms while keeping the same Post instance.</p>
28-
<h4>Example</h4><pre><code class="language-ts"><span class="hl-3">import</span><span class="hl-1"> {</span><span class="hl-0">Post</span><span class="hl-1">} </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-4">&quot;@quickdevelopment/wp-js&quot;</span><span class="hl-1">;</span><br/><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">searchTermPosts</span><span class="hl-1"> = </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-5">Post</span><span class="hl-1">();</span><br/><br/><span class="hl-0">searchTermPosts</span><span class="hl-1">.</span><span class="hl-5">bySearchTerm</span><span class="hl-1">(</span><span class="hl-4">&#39;hello-world&#39;</span><span class="hl-1">).</span><span class="hl-5">fetch</span><span class="hl-1">().</span><span class="hl-5">then</span><span class="hl-1">((</span><span class="hl-0">posts</span><span class="hl-1">) </span><span class="hl-6">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-2">// This will return the post from slug &#39;hello-world&#39;.</span><br/><span class="hl-1"> </span><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-5">log</span><span class="hl-1">(</span><span class="hl-0">posts</span><span class="hl-1">)</span><br/><span class="hl-1">})</span>
28+
<h4>Example</h4><pre><code class="language-ts"><span class="hl-3">import</span><span class="hl-1"> {</span><span class="hl-0">Post</span><span class="hl-1">} </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-4">&quot;@quickdevelopment/wp-js&quot;</span><span class="hl-1">;</span><br/><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">searchTermPosts</span><span class="hl-1"> = </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-5">Post</span><span class="hl-1">();</span><br/><br/><span class="hl-0">searchTermPosts</span><span class="hl-1">.</span><span class="hl-5">bySearchTerm</span><span class="hl-1">(</span><span class="hl-4">&#39;hello-world&#39;</span><span class="hl-1">).</span><span class="hl-5">fetch</span><span class="hl-1">().</span><span class="hl-5">then</span><span class="hl-1">((</span><span class="hl-0">posts</span><span class="hl-1">) </span><span class="hl-6">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-2">// This will return the post from search term &#39;hello-world&#39;.</span><br/><span class="hl-1"> </span><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-5">log</span><span class="hl-1">(</span><span class="hl-0">posts</span><span class="hl-1">)</span><br/><span class="hl-1">})</span>
2929
</code><button>Copy</button></pre>
3030
</div><aside class="tsd-sources"><ul><li>Defined in Api/Post.ts:64</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="bySlug" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>by<wbr/>Slug</span><a href="#bySlug" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="bySlug.bySlug-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">by<wbr/>Slug</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">slug</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#bySlug.bySlug-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Set the slug.</p>
3131
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">slug</span>: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>2.0.0</p>

lib/Api/Post.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default class Post<T = PostDataType[] | PostDataType> extends WPJSBase<T>
5757
* const searchTermPosts = new Post();
5858
*
5959
* searchTermPosts.bySearchTerm('hello-world').fetch().then((posts) => {
60-
* // This will return the post from slug 'hello-world'.
60+
* // This will return the post from search term 'hello-world'.
6161
* console.log(posts)
6262
* })
6363
*/

0 commit comments

Comments
 (0)