Create wordpress post
Line 1: | Line 1: | ||
− | The '''create wordpress post''' command creates a new post or | + | The '''create wordpress post''' command creates a new post, page, or custom post type on a WordPress website. |
− | + | ||
− | + | ||
== Parameters == | == Parameters == | ||
− | '''Post Title:''' The title of your new post | + | '''Post Title:''' The title of your new post. |
− | '''Post Content:''' The content of your new post | + | '''Post Content:''' The content of your new post. |
− | '''Post Status:''' (Optional) Choose the status for the new post | + | '''Post Status:''' (Optional) Choose the status for the new post. Options include "draft" (the post will not be published until you manually publish it) and "public" (the post will be published immediately). Default is "draft". |
− | '''Post Type:''' (Optional) Define the post type for the new post | + | '''Post Type:''' (Optional) Define the post type for the new post. Options include "post" (the content will be created as a blog post) and "page" (the content will be created as a static page). You may also manually enter any custom post type here. Default is "post". |
'''Post ID Variable:''' (Optional) This advanced parameter allows the bot to store the post ID in a variable after the post is created. This is useful if you want to refer to the post later in your script. | '''Post ID Variable:''' (Optional) This advanced parameter allows the bot to store the post ID in a variable after the post is created. This is useful if you want to refer to the post later in your script. | ||
Line 17: | Line 15: | ||
== Example == | == Example == | ||
<pre> | <pre> | ||
− | + | connect to wordpress("https://yourwordpresssite.com", "username", "password") | |
create wordpress post("My New Blog Post", "This is the content of my new blog post.", "public", "post", #my post id) | create wordpress post("My New Blog Post", "This is the content of my new blog post.", "public", "post", #my post id) | ||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
− | + | Remember to replace "https://yourwordpresssite.com", "username", and "password" with your WordPress site's URL, your username, and your password, respectively. Replace "My New Blog Post" and "This is the content of my new blog post." with your own title and content. | |
− | + | This script will create a new public post with the title "My New Blog Post" and the content "This is the content of my new blog post." on your WordPress website. After the post is created, it will store the post's ID in the #my post id variable. |
Latest revision as of 01:01, 4 July 2023
The create wordpress post command creates a new post, page, or custom post type on a WordPress website.
[edit] Parameters
Post Title: The title of your new post.
Post Content: The content of your new post.
Post Status: (Optional) Choose the status for the new post. Options include "draft" (the post will not be published until you manually publish it) and "public" (the post will be published immediately). Default is "draft".
Post Type: (Optional) Define the post type for the new post. Options include "post" (the content will be created as a blog post) and "page" (the content will be created as a static page). You may also manually enter any custom post type here. Default is "post".
Post ID Variable: (Optional) This advanced parameter allows the bot to store the post ID in a variable after the post is created. This is useful if you want to refer to the post later in your script.
[edit] Example
connect to wordpress("https://yourwordpresssite.com", "username", "password") create wordpress post("My New Blog Post", "This is the content of my new blog post.", "public", "post", #my post id)
Remember to replace "https://yourwordpresssite.com", "username", and "password" with your WordPress site's URL, your username, and your password, respectively. Replace "My New Blog Post" and "This is the content of my new blog post." with your own title and content.
This script will create a new public post with the title "My New Blog Post" and the content "This is the content of my new blog post." on your WordPress website. After the post is created, it will store the post's ID in the #my post id variable.