Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Yoav Farhi - Getting started with WP-CLI - WordCamp Athens 2016

Yoav Farhi - Getting started with WP-CLI - WordCamp Athens 2016

WordPress Greek Community

November 19, 2016
Tweet

More Decks by WordPress Greek Community

Other Decks in Programming

Transcript

  1. The original presentation was a live demo 
 
 The

    following slides are just a recap of the commands presented.
  2. # Mac Setup ‣ chmod +x wp-cli.phar ‣ sudo mv

    wp-cli.phar /usr/local/bin/wp
  3. # wp-config.php creation ‣ wp core config
 --dbname=wpcli 
 --dbuser=root

    
 --dbpass=root 
 --dbhost=localhost 
 --dbprefix=wpcli_
  4. # Install ‣ wp core install 
 --url="http://wpcli.dev" 
 --title="WP-CLI

    Demo" 
 --admin_user=yoav 
 --admin_password=mypassword 
 [email protected]
  5. # Packages ‣ wp package ‣ wp package list ‣

    wp package install
 aaemnnosttv/wp-cli-http-command
  6. # Import ‣ wp plugin install wordpress-importer 
 --activate ‣

    wp http get 
 https://wpcom-themes.svn.automattic.com/ demo/theme-unit-test-data.xml 
 --scheme=https 
 > theme-unit-test-data.xml ‣ wp import theme-unit-test-data.xml 
 --authors=create
  7. # Sticky posts option ‣ wp option get sticky_posts ‣

    wp option update sticky_posts [] 
 --format=json
  8. # Post with external data ‣ wp http get http://loripsum.net/api/5

    
 | wp post generate 
 --post_content 
 --count=1
  9. # Scaffolding ‣ wp scaffold child-theme my-new-theme 
 --parent_theme=twentysixteen 


    --author_uri=http://yoav.fr 
 --activate
 ‣ wp scaffold _s iloveathens 
 --theme_name="I love Athens!" 
 --author="Yoav Farhi" 
 --sassify
  10. # Export / DB ‣ wp export ‣ wp db

    export l33t-backup.sql
  11. # Multisite ‣ wp core multisite-convert ‣ wp site create

    --slug=new-site ‣ wp theme activate twentyfourteen 
 --url=http://wpcli.dev/new-site