diff --git a/JoeBlogs/Mapper.cs b/JoeBlogs/Mapper.cs index 555b347..a0e9116 100644 --- a/JoeBlogs/Mapper.cs +++ b/JoeBlogs/Mapper.cs @@ -215,7 +215,9 @@ internal static XmlRpcPost Post(Post input) postid = input.PostID, title = input.Title, permaLink = input.Permalink, + wp_slug = input.Slug, post_type = input.PostType, + mt_allow_comments = input.CommentsEnabled ? "open" : "closed", custom_fields = input.CustomFields == null ? null : input.CustomFields.Select(cf => new XmlRpcCustomField() { id = cf.ID, diff --git a/JoeBlogs/classes/Post.cs b/JoeBlogs/classes/Post.cs index 67b0ad2..14e05b7 100644 --- a/JoeBlogs/classes/Post.cs +++ b/JoeBlogs/classes/Post.cs @@ -6,8 +6,8 @@ public class Post { public Post() { - DateCreated = DateTime - .Now; + DateCreated = DateTime.Now; + CommentsEnabled = true; } public int PostID { get; set; } @@ -21,6 +21,9 @@ public Post() public CustomField[] CustomFields { get; set; } public Term[] Terms { get; set; } public string PostType { get; set; } + public bool CommentsEnabled { get; set; } + public string Slug { get; set; } + public override string ToString() { diff --git a/JoeBlogs/xmlRpcStructs/Post.cs b/JoeBlogs/xmlRpcStructs/Post.cs index 46b5499..d74b161 100644 --- a/JoeBlogs/xmlRpcStructs/Post.cs +++ b/JoeBlogs/xmlRpcStructs/Post.cs @@ -22,7 +22,7 @@ public struct XmlRpcPost public string mt_excerpt; public string mt_text_more; public string wp_more_text; - public int mt_allow_comments; + public string mt_allow_comments; public int mt_allow_pings; public string mt_keywords; public string wp_slug;