Find wordpress post by title

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Return Value)
(Example)
 
Line 13: Line 13:
 
connect to wordpress("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)
log($find wordpress post title("My New Blog Post"))
+
log object($find wordpress post title("My New Blog Post"))
 
</pre>
 
</pre>
  

Latest revision as of 01:40, 4 July 2023

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

[edit] Parameters

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

[edit] Return Value

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

[edit] 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 title("My New Blog Post"))

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

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox