You are here

function ctools_plugin_load_function in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 includes/plugins.inc \ctools_plugin_load_function()

Load a plugin and get a function name from it, returning success only if the function exists.

Parameters

$module: The module that owns the plugin type.

$type: The type of plugin.

$id: The id of the specific plugin to load.

$function_name: The identifier of the function. For example, 'settings form'.

Return value

string The actual name of the function to call, or NULL if the function does not exist.

8 calls to ctools_plugin_load_function()
CtoolsPluginsGetInfoTestCase::assertPluginFunction in tests/ctools.plugins.test
Assert helper to check that a specific plugin function exists.
CtoolsPluginsGetInfoTestCase::assertPluginMissingFunction in tests/ctools.plugins.test
Assert helper to check that a specific plugin function does NOT exist.
ctools_context_get_context_from_argument in includes/context.inc
Get a context from an argument.
ctools_context_get_context_from_relationship in includes/context.inc
Return a context from a relationship.
page_manager_delete_task_handler in page_manager/page_manager.module
Remove a task handler.

... See full list

File

includes/plugins.inc, line 842
Contains routines to organize and load plugins. It allows a special variation of the hook system so that plugins can be kept in separate .inc files, and can be either loaded all at once or loaded only when necessary.

Code

function ctools_plugin_load_function($module, $type, $id, $function_name) {
  $plugin = ctools_get_plugins($module, $type, $id);
  return ctools_plugin_get_function($plugin, $function_name);
}