官术网_书友最值得收藏!

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
)
主站蜘蛛池模板: 永吉县| 收藏| 雷山县| 泉州市| 永仁县| 株洲县| 陈巴尔虎旗| 昌平区| 大城县| 灵寿县| 柞水县| 轮台县| 哈巴河县| 新干县| 阳高县| 普兰店市| 公主岭市| 北海市| 永昌县| 九龙坡区| 香格里拉县| 浏阳市| 上虞市| 新龙县| 云阳县| 当雄县| 昌都县| 甘孜| 个旧市| 新宁县| 贵德县| 茂名市| 巴林左旗| 凯里市| 广南县| 泸溪县| 五寨县| 多伦县| 嘉义市| 蓬安县| 鹤岗市|