wp-net / WordPressPCL

This is a portable library for consuimg the WordPress REST-API in (almost) any C# application
MIT License
338 stars 129 forks source link

Problem to create a page with template / meta #161

Closed p3t3rBl4ck closed 5 years ago

p3t3rBl4ck commented 5 years ago

Hi,

thanks for that library. I want to create a page with a template, meta description and meta title but the app go an exception "not parameter included". I can see that Page model contains a "template" field and "meta" field.

¿Can I do it?

thanks!

polushinmk commented 5 years ago

@p3t3rBl4ck it is interesting WP rest api feature, but you should set a php file template name for example:

var page = new Page()
            {
                Title = new Title("Title 1"),
                Content = new Content("Content PostCreate"),
                Template = "page-about.php"
            };
var createdPage = await _clientAuth.Pages.Create(page);