Exemplo n.º 1
0
 /**
  * Performs the import of the current webPage object as a folder.
  *
  * @param WebPage       $webPage
  * @param WPMetaConfigs $meta
  * @param Array|null    $html_post_lookup
  * @param Array|null    $media_lookup
  *
  * @return null
  */
 protected function doImport(WebPage $webPage, WPMetaConfigs $meta, &$html_post_lookup = null, &$media_lookup = null)
 {
     $updateResult = $meta->updateWPPost();
     if (is_wp_error($updateResult)) {
         echo '<li>***Unable to create folder ' . $meta->getPostTitle() . ' from ' . $meta->getSourcePath() . '</li>';
     } else {
         $webPage->setWPID($updateResult);
         echo '<li>Folder created from ' . $meta->getPostTitle() . ' into post #' . $updateResult . ' with title ' . $meta->getPostTitle() . '</li>';
     }
 }
Exemplo n.º 2
0
 /**
  * Saves the post in wordpress.
  *
  * @param WPMetaConfigs $meta
  *
  * @return int|\WP_Error
  */
 protected function save(WPMetaConfigs $meta)
 {
     return $meta->updateWPPost();
 }