diff --git a/includes/plugins.inc b/includes/plugins.inc index b548f3d75fde2185aaf9233b8b9d468b3313736d..c3571868f748ba769abf13842f7ca810e57c322a 100644 --- a/includes/plugins.inc +++ b/includes/plugins.inc @@ -1403,6 +1403,19 @@ function panels_get_include_directories($plugin_type) { * an error, it will undermine the Panels engine's lazy-loading logic and * negatively impact memory usage. * + * Note also that including a conditional on the plugin type so that you only + * define plugins for directories that you have actually populated with plugin + * include files is another small contribution to performance that you can make. + * For example, if you define only content_type and context plugins and don't + * want them at the root level of your module directory, this code would work: + * @code + * function MYMODULE_panels_include_directory($plugin_type) { + * if ($plugin_type == 'content_type' || $plugin_type == 'context') { + * return 'panels_inc/' . $plugin_type; + * } + * } + * @endcode + * * @param string $plugin_type * The plugin type for which the Panels engine is currently requesting the * location of an include directory.