Skip to content

Commit

Permalink
Deployed bb717f3 with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Apr 5, 2024
1 parent 19b5186 commit 759916b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions I version 2.x/entities/posts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
</li>
<li class="toctree-l3"><a class="reference internal" href="#update-post">Update Post</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#update-custom-fields">Update Custom Fields</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#delete-post">Delete Post</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#get-post-revisions">Get Post Revisions</a>
Expand Down Expand Up @@ -216,6 +218,25 @@ <h2 id="update-post">Update Post</h2>
var updatedPost = await client.Posts.UpdateAsync(post);
}
</code></pre>
<h2 id="update-custom-fields">Update Custom Fields</h2>
<pre><code class="language-C#">var post = new Post
{
Id = 123,
Meta = new Dictionary&lt;string, string&gt;
{
[&quot;my-custom-key&quot;] = &quot;some value&quot;
},
};

await client.Posts.UpdateAsync(post);
</code></pre>
<p>Please note that all meta keys need to be registered using <a href="https://developer.wordpress.org/reference/functions/register_post_meta/"><code>register_post_meta()</code></a> before you can use them, e.g. by using the following PHP snippet:</p>
<pre><code class="language-php">register_post_meta('post', 'my-custom-key', [
'type' =&gt; 'string',
'single' =&gt; true,
'show_in_rest' =&gt; true,
]);
</code></pre>
<h2 id="delete-post">Delete Post</h2>
<pre><code class="language-C#">// returns result of deletion
if (await client.IsValidJWTokenAsync())
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,5 +367,5 @@ <h2 id="contribution-guidelines">Contribution Guidelines</h2>

<!--
MkDocs version : 1.5.3
Build Date UTC : 2024-04-05 11:06:33.774336+00:00
Build Date UTC : 2024-04-05 11:10:50.939743+00:00
-->
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit 759916b

Please sign in to comment.