Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Array
- (
- [code] => rest_cannot_edit
- [message] => Sorry, you are not allowed to edit this user.
- [data] => Array
- (
- [status] => 401
- )
- )
- function update_user_api( $entry, $form ) {
- $user_url = 'https://myurl.com/wp-json/wp/v2/users/11?context=edit';
- $body = array(
- 'username' => '000',
- 'password' => '000',
- 'first_name' => 'test',
- );
- $response = wp_safe_remote_post( $user_url, array( 'body' => $body ) );
- $res = json_decode($response['body'], true);
- echo '<pre>';
- print_r($res);
- echo '</pre>';
- }
- add_action( 'gform_after_submission_16', 'update_user_api', 10, 2 );
Add Comment
Please, Sign In to add comment