function blogapi_metaweblog_new_post in Blog API 8
Same name and namespace in other branches
- 7.2 modules/blogapi_metaweblog/blogapi_metaweblog.module \blogapi_metaweblog_new_post()
- 7 blogapi.module \blogapi_metaweblog_new_post()
Callback for metaWeblog.newPost.
Parameters
$ct: Content type machine name.
$username: Drupal username.
$pass: Drupal password.
$data: The node contents.
$publish: Boolean Drupal publish status.
Return value
bool|object|string BlogAPI response.
1 string reference to 'blogapi_metaweblog_new_post'
- MetaweblogProvider::getMethods in modules/
blogapi_metaweblog/ src/ Plugin/ BlogapiProvider/ MetaweblogProvider.php - Returns implemented methods.
File
- modules/
blogapi_metaweblog/ blogapi_metaweblog.module, line 99 - Module file for blogapi_blogger.
Code
function blogapi_metaweblog_new_post($ct, $username, $pass, $data, $publish) {
$communicator = \Drupal::service('service.communicator.blogapi');
$formatted = [
'title' => $data['title'],
'body' => $data['description'],
'format' => $data['mt_convert_breaks'],
'publish' => $publish,
'comments' => blogapi_metaweblog_decode_comment_code($data['mt_allow_comments']),
];
return $communicator
->newPost($ct, $username, $pass, $formatted);
}