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...")
 
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 or page on a WordPress website.  
  
 
Once the command completes, WordPress will return a post ID, which the bot will then store in a variable.
 
Once the command completes, WordPress will return a post ID, which the bot will then store in a variable.

Revision as of 03:14, 3 July 2023

The 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 store in a variable.

Parameters

Post Title: The title of your new post or page.

Post Content: The content of your new post or page.

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 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 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.

Example

setup wordpress connection("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)
#prints the post id in console
ui console view
print(#my post id)

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.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox