- WordPress 3 Plugin Development Essentials
- Brian Bondari Everett Griffiths
- 115字
- 2021-04-09 21:19:58
Bonus for the curious
In case you're wondering exactly where and how WordPress stores the information about activated plugins, have a look in the database. Using your MySQL client, you can browse the wp_options
table or execute the following query:
SELECT option_value FROM wp_options WHERE option_name='active_plugins';
The active plugins are stored as a serialized PHP hash, referencing the file containing the header. The following is an example of what the serialized hash might contain if you had activated a plugin named "Bad Example". You can use PHP's unserialize() function to parse the contents of this string into a PHP variable as in the following script:
<?php $active_plugin_str = 'a:1:{i:0;s:27:"bad-example/bad-example.php";}'; print_r( unserialize($active_plugin_str) ); ?>
And here's its output:
Array ( [0] => bad-example/bad-example.php )
推薦閱讀
- 自己動手寫分布式搜索引擎
- Word-Excel-PowerPoint 2010三合一從新手到高手(超值版)
- 中文版AutoCAD 2016從入門到精通
- AutoCAD 2017實用教程
- 數字孿生體:第四次工業革命的通用目的技術
- Unity 2D與3D手機游戲開發實戰
- ABAQUS有限元分析從入門到精通(第3版)
- AutoCAD 2018中文版基礎教程
- Google App Engine Java and GWT Application Development
- Unreal Development Kit Beginner's Guide
- 原片蛻變:Photoshop CC商業修圖必修課
- 中文版3ds Max 2016/VRay效果圖制作實戰基礎教程(全彩版)
- UG NX 12.0中文版實戰從入門到精通
- PyTorch教程:21個項目玩轉PyTorch實戰
- 零基礎學Revit 2018建筑設計(全視頻教學版)