Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction to WP-CLI
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
140
Building Pages in WordPress
kjohnson
0
170
Gutenberg
kjohnson
0
380
Separate your time from your income
kjohnson
0
470
iThemes Exchange
kjohnson
0
130
Easy Digital Downloads
kjohnson
0
84
PHP Templating
kjohnson
0
130
WordPress Taxonomies
kjohnson
0
86
objects-a-short-intro.pdf
kjohnson
0
200
Other Decks in Programming
See All in Programming
Claude Code Skill入門
mayahoney
0
140
Ruby and LLM Ecosystem 2nd
koic
0
360
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
120
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
370
TipKitTips
ktcryomm
0
160
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
250
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
180
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.7k
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
520
Ruby x Terminal
a_matsuda
7
590
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
7.8k
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
210
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Building an army of robots
kneath
306
46k
Navigating Weather and Climate Data
rabernat
0
130
Measuring & Analyzing Core Web Vitals
bluesmoon
9
780
Six Lessons from altMBA
skipperchong
29
4.2k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.4k
Test your architecture with Archunit
thirion
1
2.2k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
230
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
The untapped power of vector embeddings
frankvandijk
2
1.6k
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