Create wordpress post

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''create wordpress post''' command creates a new post or page on a WordPress website. Once the command completes, WordPress will return a post ID, which the bot will then s...")
 
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
'''create wordpress post''' command creates a new post or page on a WordPress website.
+
The '''create wordpress post''' command creates a new post, page, or custom post type on a WordPress website.  
 
+
Once the command completes, WordPress will return a post ID, which the bot will then store in a variable.
+
  
 
== Parameters ==
 
== Parameters ==
  
'''Post Title:''' The title of your new post or page.
+
'''Post Title:''' The title of your new post.
  
'''Post Content:''' The content of your new post or page.
+
'''Post Content:''' The content of your new post.
  
'''Post Status:''' (Optional) Choose the status for the new post or page. 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 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 or page. Options include "post" (the content will be created as a blog post) and "page" (the content will be created as a static page). Default is "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>
setup wordpress connection("https://yourwordpresssite.com", "username", "password")
+
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)
#prints the post id in console
 
ui console view
 
print(#my post id)
 
 
</pre>
 
</pre>
  
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 and print the post ID in the console.
+
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.
  
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.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox