Custom modules Advanced Tab

I’m noticing new custom modules I build don’t have an Advanced tab, is it possible to add the same Advanced tab the built-in modules support?

Hey Steve,

They should be inheriting that. If you send over the modules to the email mentioned in the other thread I’ll take a look.

Thanks,
Justin

I think I know what’s going wrong, I chose to just drop my module in an existing plugin directory and include a call to the module file rather than using it as a true plugin activated from the Plugins page. And then I…ahem…commented out this line because it wouldn’t activate the module with it uncommented-

//if(class_exists('FLBuilder')) {

...

//}

So my custom module was being used, but obviously not perfectly with the missing Advanced tab. So I guess my question is now, how do you include custom modules without adding them as plugins?

Hey Steve,

We haven’t tested dropping modules in another plugin, so that may be what’s causing the issue. However, I did just find out that our example is incorrect. The class_exists check needs to be inside of the init function like so…

// Custom modules
function fl_load_module_examples() {
    if(class_exists('FLBuilder')) {
        require_once 'location/location.php';
    }
}
add_action('init', 'fl_load_module_examples');

Can you give that a shot and let me know if that solves your issues?

Thanks,
Justin

I gave it a try, I no longer need to comment out the class_exists test in order to use my custom module, but I’m still not seeing the Advanced tab.

Hi Steve,

I didn’t have that issue so I’m not sure what the problem could be yet. Can you send over temporary admin and FTP login info so I can test?

Thanks,
Justin

I figured it out, I noticed the Advanced tab was being generated (no title on the tab so it appeared invisible), and there was an error in the Advanced tab content-

Warning: Invalid argument supplied for foreach() in /public_html/wp-content/plugins/bb-plugin/includes/settings.php on line 27

I tried throwing my include into an after_setup_theme add_action and that seems to have fixed it.

Hey Steve,

I’m glad to hear that worked out. Let me know if there is anything else!

Justin