Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction to WP-CLI
Search
Kyle B. Johnson
November 02, 2017
Programming
0
330
Introduction to WP-CLI
Kyle B. Johnson
November 02, 2017
Tweet
Share
More Decks by Kyle B. Johnson
See All by Kyle B. Johnson
Continuously Delivering Value
kjohnson
0
130
Building Pages in WordPress
kjohnson
0
170
Gutenberg
kjohnson
0
380
Separate your time from your income
kjohnson
0
460
iThemes Exchange
kjohnson
0
120
Easy Digital Downloads
kjohnson
0
84
PHP Templating
kjohnson
0
130
WordPress Taxonomies
kjohnson
0
86
objects-a-short-intro.pdf
kjohnson
0
190
Other Decks in Programming
See All in Programming
React Native New Architecture 移行実践報告
taminif
1
150
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
6
2.2k
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
認証・認可の基本を学ぼう前編
kouyuume
0
200
WebRTC と Rust と8K 60fps
tnoho
2
2k
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
160
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
2.9k
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
310
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
130
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
130
Microservices rules: What good looks like
cer
PRO
0
1.3k
Cap'n Webについて
yusukebe
0
130
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Designing for Performance
lara
610
69k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
We Have a Design System, Now What?
morganepeng
54
7.9k
A Tale of Four Properties
chriscoyier
162
23k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
The Cult of Friendly URLs
andyhume
79
6.7k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Transcript
The command line interface for WordPress_ ./WP-CLI
$ wp plugin install ninja-forms Installing Ninja Forms (3.0) Downloading
install package... Unpacking the package... Installing the plugin... Plugin installed successfully. Success: Installed 1 of 1 plugins.
$ wp core download Downloading WordPress 4.8 Md5 hash verified:
c5366d0521831dd029dfc38e56a5 Success: WordPress downloaded.
$ wp core install Success: WordPress installed successfully.
$ wp plugin update Updating to version 4.9 Downloading update...
Unpacking the update... Success: WordPress updated successfully.
Use Cases
Example Use Cases • Plugin/Theme Development • Local Development Environments
• Client Site Maintenance • WordPress as a Service
Plugin/Theme Development • Scaffold new plugins • Run PHPUnit tests
Local Development Environments • Download/Install/Update WordPress • Auto install plugins/themes
• Search/Replace database values (site migration) • Launch PHP’s built-in web server $ wp serve –-host=wordpress.dev ~/code/wordpress now available at wordpress.dev:80
Client Site Maintenance • Remotely Update WordPress (SSH) • Check
for plugin updates • Restore down sites (white-screen of death) $ wp plugin deactivate <plugin name> --skip-plugins Success: Plugin <plugin name> deactivated.
WordPress as a Service • Check for updates • Create
user accounts • Create new installs $ wp site create --slug=example Success: Site 3 created. wordpress.dev/example
Extending WP-CLI
$ wp ninja-forms list-forms public function list_forms( $args, $assoc_args )
{ foreach( Ninja_Forms()->forms() as $form ){ WP_CLI::line( ‘#’ . $form[‘title’] ); } }
Outside of WordPress
Laravel $ artisan # Generate a new controller. $ artisan
make:controller PostController # Re-run database migration with seed data. $ artisan migrate:refresh --seeds
Drupal $ drush # Run pending updates on staging site.
$ drush @staging updatedb # Synchronize staging files to production. $ drush rsync @staging @ list