How to bundle a plugin with a theme, or vice versa

You can use some of the following functions to build your own “theme plugins” registration:

is_plugin_active( $plugin );
is_plugin_active_for_network( $plugin );
is_plugin_inactive( $plugin );

get_plugins( $plugin_folder ); // register your own theme-plugins folder?
get_plugin_data( $plugin_file );

I use “theme plugins” myself. But not in the manner of: I have dozens of “real” plugins and then require some user to install them, but more in the fashion of: I question the existance of sub folders and register them with current_theme_supports( 'theme-plugin-xy' ) and then include their files.

Leave a Comment