You are here

function blogapi_metaweblog_get_post in Blog API 8

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

Callback for metaWeblog.getPost.

Parameters

$nid: The node ID.

$username: Drupal username.

$pass: Drupal password.

Return value

mixed BlogAPI response.

1 string reference to 'blogapi_metaweblog_get_post'
MetaweblogProvider::getMethods in modules/blogapi_metaweblog/src/Plugin/BlogapiProvider/MetaweblogProvider.php
Returns implemented methods.

File

modules/blogapi_metaweblog/blogapi_metaweblog.module, line 176
Module file for blogapi_blogger.

Code

function blogapi_metaweblog_get_post($nid, $username, $pass) {
  $communicator = \Drupal::service('service.communicator.blogapi');
  $node = $communicator
    ->getPost($nid, $username, $pass);
  if ($communicator
    ->responseIsError($node)) {
    return $node;
  }
  return $communicator
    ->formatXml($node, TRUE);
}