CMDG 09: Module method reference

add_css( $handle, $src, $deps, $ver, $media )
Use this method to register and enqueue additional styles for your module. Using this method ensures that your styles will only be loaded when the module is present on the page, instead of loading it on every page. This method can be used just like you would use the wp_enqueue_style function.

Example:

add_js( $handle, $src, $deps, $ver, $in_footer )
Use this method to register and enqueue additional scripts for your module. Using this method ensures that your scripts will only be loaded when the module is present on the page, instead of loading it on every page. This method can be used just like you would use the wp_enqueue_script function.

Example:

remove()
This method should not be called directly by developers. It is called by Beaver Builder when a module is being removed from the page. Developers should override this method in their module class if they need to work with a module before it is removed from the page.

Example:

delete()
This method should not be called directly by developers. It is called by Beaver Builder when a module is being deleted. Developers should override this method in their module class if they need to work with a module before it is deleted.

Note: This method is called when a module is updated and when it's removed from the page and should be used for things like clearing photo cache from Beaver Builder's cache directory. If you only need to run logic when a module is actually removed from the page, use the remove method instead.

Example:

enqueue_scripts()
This method should not be called directly by developers. It is called by Beaver Builder when module scripts and styles are being enqueued. Developers should override this method in their module class if they need to conditionally enqueue styles and scripts for their modules.

Example:

update( $settings )
This method should not be called directly by developers. It is called by Beaver Builder when a module is being updated and passed the module settings that can be modified before they are saved to the database. Developers should override this method in their module class if they need to work with settings before they are saved.

Example:

Previous:
8. Module property reference
Next: 
10. Setting fields reference