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
update_wp_page(
  root_url,
  user,
  pass,
  page_id,
  title_val,
  excerpt_val = "",
  fifu_val,
  content_val,
  status_val,
  author_val
)

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'.

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
 8
 9
10
## 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',author_val = '2')

## End(Not run)

wordpressr documentation built on June 2, 2021, 1:06 a.m.