wp_get_posts: Get all posts across all sites of the authenticated user

Description Usage Arguments Value References Examples

View source: R/my-posts.R

Description

Get all posts across all sites of the authenticated user

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
wp_get_posts(
  context = c("edit", "display"),
  author = NULL,
  after = NULL,
  before = NULL,
  modified_after = NULL,
  modified_before = NULL,
  status = NULL,
  search = NULL,
  sites = NULL,
  .quiet = FALSE
)

Arguments

context

'edit' (default) for raw post source; 'display' for HTML rendered source.

author

id of the author or empty (the default) for 'all authors'

after, before

(POSIXct or Date object or string that can be converted to one of those) Return posts dated before/after the specified datetime.

modified_after, modified_before

(POSIXct or Date object) Return posts modified before/after the specified datetime.

status

Comma-separated list of statuses for which to query, including any of: "publish", "private", "draft", "pending", "future", and "trash", or simply "any". Defaults to "publish"

search

Search query checked against 'title', 'content', 'category.name', 'tag.name', and 'author', and will return results sorted by relevance. Limit: 250 characters

sites

Optional comma-separated list of specific site IDs to further limit results

.quiet

if 'TRUE' then no progress information will be displayed

Value

data frame of posts

References

<https://developer.wordpress.com/docs/api/1.1/get/me/posts/>

Examples

1
2
3
4
if (interactive()) {
  wp_auth()
  my_posts <- wp_get_posts()
}

hrbrmstr/pressur documentation built on June 30, 2020, 6:04 a.m.