Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need to create a single post with title, content and excerpt with this command as it's described in the utility documentation. Could you please show me an example of how to use it? I couldn't find nor in official documentation neither on Google. Thanks!

share|improve this question
    
github.com/wp-cli/wp-cli/wiki –  kaiser Sep 27 '12 at 23:33
    
There are no examples how to create a post. –  Sergey Basharov Sep 28 '12 at 8:00
    
I never used it, but found it within 20secs.: wp generate posts --count=1000 generates 1k posts for you. Just read yourself please. –  kaiser Sep 28 '12 at 12:44
    
There is also a command wp post create, that's what I am asking about. I don't want to generate dummy posts, I need to create a single post with title, content and excerpt. –  Sergey Basharov Sep 28 '12 at 12:59
    
So then update your post with an info and a link and we start from the beginning. –  kaiser Sep 28 '12 at 13:03
add comment

2 Answers

up vote 3 down vote accepted

If you type wp help post create you will get all the info you need.

Example:

wp post create --post_type=page --post_status=publish --post_title='A new page'
share|improve this answer
add comment

If you look at the code for the create method, you'll see that it takes 2 parameters:

    public function create( $args, $assoc_args ) 

$args doesn't seem to be used - $assoc_args is the array passed to the wp_insert_post function from WordPress core. The linked Codex page explains the array parameters.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.