You are here

function blogapi_blogger_edit_post in Blog API 8

Same name and namespace in other branches
  1. 7.2 modules/blogapi_blogger/blogapi_blogger.module \blogapi_blogger_edit_post()
  2. 7 blogapi.module \blogapi_blogger_edit_post()

Callback for blogger.editPost.

Parameters

$hash: Unused variable.

$nid: Drupal node ID.

$username: Drupal username.

$pass: Drupal password.

$content: Node contents.

$publish: Bool variable with publish status.

Return value

mixed Return a response.

1 string reference to 'blogapi_blogger_edit_post'
BloggerProvider::getMethods in modules/blogapi_blogger/src/Plugin/BlogapiProvider/BloggerProvider.php
Returns implemented methods.

File

modules/blogapi_blogger/blogapi_blogger.module, line 193

Code

function blogapi_blogger_edit_post($hash, $nid, $username, $pass, $content, $publish) {
  $communicator = \Drupal::service('service.communicator.blogapi');
  $formatted = [
    'title' => blogapi_blogger_get_title($content),
    'body' => preg_replace('/<title>.*?<\\/title>/i', '', $content),
    'publish' => $publish,
  ];
  return $communicator
    ->editPost($nid, $username, $pass, $formatted);
}