2

If my plugin has multiple php files in its plugin folder, how does WordPress know which is the main php file ?

0

1 Answer 1

7

WordPress has no convention for naming of main file. It scans whole plugins directory (see get_plugins() ) and looks for plugin header (with get_plugin_data())in every PHP file on appropriate directory levels.

This is only performed when you actually need full list of plugins. Thing like active plugins are calculated and stored separately so that for it there is no need for search every load.

Note that this has curious side effect of technically allowing more than one main plugin file in plugin folder. All kinds of bad idea, don't go there. :)

Not the answer you're looking for? Browse other questions tagged or ask your own question.