update_wp_page: Update WordPress Page

Description Usage Arguments Value Examples

View source: R/update-wp-page.R

Description

Updates an existing WordPress page with new values.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
update_wp_page(
  root_url,
  user,
  pass,
  page_id,
  title_val,
  excerpt_val = "",
  fifu_val,
  content_val,
  status_val,
  slug_val = NULL,
  author_val,
  format_val = "standard"
)

Arguments

root_url

The domain on which you wish to create the page.

user

The username to be passed into the API call to create the page.

pass

The password to be used in the API call to create the page. To get this value, you must have the Application Passwords plugin installed, and must create an application using that plugin via your WordPress admin panel; there you will get the password needed.

page_id

The numeric ID in the WordPress database associated with the page being updated.

title_val

The title of the page being updated.

excerpt_val

The excerpt to be shown where your WordPress features excerpts of pages.

fifu_val

If the FIFU plugin is installed, the URL of the featured image can be inserted here.

content_val

The content of the page.

status_val

The status of the page. Can be one of 'draft','publish','pending','future','private'.

slug_val

The slug to be assigned to the page. Can be automatically generated if left as NULL.

author_val

The user ID of the author to be associated with the page.

Value

A list containing the status code of the API call. A status code of 200 indicates the call was a success.

Examples

1
2
3
4
5
6
7
## Not run: 
update_wp_page(root_url = 'https://domain.com',user = Sys.getenv('username'),pass = Sys.getenv('password'),
page_id = 123,title_val = 'post title',excerpt_val = 'post excerpt',fifu_val = 'https://remotesite.com/image.png',
content_val = 'the page content as a string, with wordpress-accepted <strong>html</strong> (or bbcode!)',
status_val = 'draft',slug_val = NULL, author_val = '2')

## End(Not run)

simitpatel/wordpressr documentation built on Dec. 31, 2021, 6:38 a.m.