Get wordpress posts

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Return Value)
(Parameters)
 
Line 5: Line 5:
 
== Parameters ==
 
== Parameters ==
  
'''Post Type:''' The type of the posts you want to retrieve. Options include "post" (for blog posts) and "page" (for static pages). Default is "post".
+
'''Post Type:''' The type of the posts you want to retrieve. Options include "post" (for blog posts) and "page" (for static pages). You can also manually enter any custom post type. Default is "post".
  
 
== Return Value ==
 
== Return Value ==

Latest revision as of 01:42, 4 July 2023

$find wordpress posts by type is a function that retrieves all posts of specific type from a WordPress site.

This function will return a list of all posts of the specific type as a string format including the post IDs, titles, and content.

[edit] Parameters

Post Type: The type of the posts you want to retrieve. Options include "post" (for blog posts) and "page" (for static pages). You can also manually enter any custom post type. Default is "post".

[edit] Return Value

This function returns a yaml object which contains a list of all posts of the chosen type, including their IDs, titles, and contents.

[edit] Example

connect to wordpress("https://yourwordpresssite.com", "username", "password")
log object($find wordpress posts by type("post"))

This script connects to your WordPress website and retrieves and prints all posts of type "post".

Remember to replace "https://yourwordpresssite.com", "username", and "password" with your WordPress site's URL, your username, and your password, respectively. Adjust "post" to the type of posts you want to retrieve.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox