Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion controllers/dashboard/wordpress_import/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ function import_wordpress_site(){
$dc = $item->children($namespaces['dc']);
$author = (string)$dc->creator;
$parentID = (int)$wp->post_parent;
$postName = (string)$wp->post_name;

$out_tags = array();
$out_categories = array();
Expand All @@ -197,6 +198,7 @@ function import_wordpress_site(){
$p->setContent($content);
$p->setAuthor($author);
$p->setWpParentID($parentID);
$p->setPostName($postName);
$p->setPostDate($postDate);
$p->setPostType($postType);
$p->setCategory($out_categories);
Expand Down Expand Up @@ -305,7 +307,11 @@ function addWordpressPage(Page $p, CollectionType $ct, PageLite $pl, $xmlID){
}


$pageData = array('cName' => $pl->getTitle(),'cDatePublic'=>$pl->getPostdate(),'cDateAdded'=>$pl->getPostdate(),'cDescription' => $pl->getExcerpt(), 'uID'=> $uID);
if ( "POST" == $pl->getPostType() ){
$pageData = array('cName' => $pl->getTitle(),'cDatePublic'=>$pl->getPostdate(),'cDateAdded'=>$pl->getPostdate(),'cDescription' => $pl->getExcerpt(), 'uID'=> $uID, 'cHandle' => $pl->getPostID());
} else {
$pageData = array('cName' => $pl->getTitle(),'cDatePublic'=>$pl->getPostdate(),'cDateAdded'=>$pl->getPostdate(),'cDescription' => $pl->getExcerpt(), 'uID'=> $uID, 'cHandle' => $pl->getPostName());
}
$newPage = $p->add($ct,$pageData);

if (is_array($pl->getCategory())){
Expand Down
7 changes: 7 additions & 0 deletions models/page_lite.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class PageLite extends Object{
protected $tags;
protected $postDate;
protected $wpPostID; //needed to relate
protected $wpPostName; //needed to slug
function setPropertiesFromArray($array){
//TODO: maybe put some preg_replace here?
parent::setPropertiesFromArray($array);
Expand Down Expand Up @@ -82,4 +83,10 @@ function setExcerpt($ex){
function getExcerpt(){
return $this->wpExcerpt;
}
function setPostName($post_name){
$this->wpPostName = $post_name;
}
function getPostName(){
return $this->wpPostName;
}
}