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

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
)
主站蜘蛛池模板: 沂南县| 柯坪县| 罗定市| 沾化县| 红安县| 西藏| 洪湖市| 保德县| 秦安县| 临汾市| 上饶县| 航空| 汪清县| 马尔康县| 高要市| 新邵县| 旬邑县| 永丰县| 恩施市| 聂荣县| 外汇| 交城县| 鲜城| 彭水| 呼图壁县| 榆中县| 雷波县| 伊川县| 包头市| 布尔津县| 洪泽县| 南皮县| 万山特区| 德江县| 洮南市| 中卫市| 大余县| 高雄市| 仙桃市| 子洲县| 封丘县|