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

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
)
主站蜘蛛池模板: 武义县| 华蓥市| 四子王旗| 嘉义市| 黔东| 兴隆县| 武强县| 屏边| 亚东县| 宜良县| 平湖市| 元朗区| 阳山县| 上高县| 灵石县| 从江县| 莱阳市| 舞钢市| 隆林| 株洲市| 威宁| 农安县| 张北县| 涪陵区| 稷山县| 江北区| 苗栗县| 迁西县| 栖霞市| 蓬安县| 久治县| 行唐县| 华阴市| 宁化县| 奉节县| 麦盖提县| 长春市| 巴彦淖尔市| 贡嘎县| 剑川县| 金秀|