load an extension directly in a component (not in a plugin way)
-
Hi, i’ve created an extension for my component.
If I use it as a plugin (with a header, etc); it works perfectly.
But I would like to include it directly in my component;
require ( WP_PLUGIN_DIR . '/bp-classifieds/bp-classifieds-groups.php' );
but then it does a fatal error :
Class ‘BP_Group_Extension’ not found in F:webkinewordpress-muwp-contentpluginsbp-classifiedsbp-classifieds-groups.php on line 5
So I guess I have to load in with a hook.
But which one ?
I did try
function classifieds_group_extension_init() {
require ( WP_PLUGIN_DIR . ‘/bp-classifieds/bp-classifieds-groups.php’ );
}
with
add_action(‘init’,’classifieds_group_extension_init’);
or
add_action(‘wp’,’classifieds_group_extension_init’);
But it does not work.
Please help
- The topic ‘load an extension directly in a component (not in a plugin way)’ is closed to new replies.