- 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 )
推薦閱讀
- Hadoop核心技術(shù)
- Flash CC從入門到精通
- 鍵盤錄入技術(shù)(第2版)
- YUI 2.8: Learning the Library
- Maya建模技術(shù)解析
- Word 2010實(shí)戰(zhàn)技巧精粹
- 3ds Max/MaxScript印象 腳本動(dòng)畫制作基礎(chǔ)與應(yīng)用
- SketchUp/Piranesi印象彩繪表現(xiàn)項(xiàng)目實(shí)踐
- PHP 5 Social Networking
- 陌上花開:古風(fēng)CG插畫繪制技法精解(花卉篇)
- IBM WebSphere eXtreme Scale 6
- 音樂日記:Studio One 6場(chǎng)景×風(fēng)格編曲實(shí)用教程
- 詳解AutoCAD 2022室內(nèi)設(shè)計(jì)(第6版)
- 中文版Photoshop平面設(shè)計(jì)入門教程
- Building Websites with Mambo