Find wordpress post by id

From UBot Studio
Revision as of 01:23, 4 July 2023 by LillyT (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

$find wordpress post is a function that retrieves a specific post or page from a WordPress site using its ID.

Parameters

Post ID: The ID of the post or page you want to retrieve.

Return Value

This function returns a yaml object which contains the entire post, including its title and contents and other relevant data.

Example

ui console view
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)
log object($find wordpress post(#my post id))

This script creates a new public post on your WordPress website, saves its ID, and then retrieves and prints the post using its 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.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox