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

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
)
主站蜘蛛池模板: 岑巩县| 清丰县| 龙州县| 白朗县| 孟津县| 株洲市| 阳春市| 巫山县| 上饶市| 乐昌市| 临邑县| 舟山市| 东城区| 报价| 墨江| 乡城县| 介休市| 偃师市| 兴业县| 白玉县| 开江县| 阳新县| 龙泉市| 广西| 安新县| 同心县| 桑植县| 三门县| 股票| 紫金县| 永新县| 绵竹市| 永新县| 都匀市| 阿拉善右旗| 邳州市| 伊宁市| 淄博市| 阿瓦提县| 泸州市| 财经|