ult_after_directory_modules
Fires after the directory modules have been processed, allowing modification of the module data.
add_action( 'ult_after_directory_modules', $callback, 10, 1 );
Description
Fires after the directory modules have been rendered in the Ultimate Addons admin area. Developers can use this hook to add custom content or modify the output before the admin page is fully displayed.
Usage
add_action( 'ult_after_directory_modules', 'your_function_name', 10, 1 );
Parameters
-
$modules(mixed) - The `$modules` parameter is a mixed type variable that holds information about the modules displayed in the directory.
Examples
<?php
/**
* Example function to add custom logic after the Ultimate Addons for Elementor
* directory modules are displayed.
*
* This function demonstrates how to access the $modules parameter, which is
* a mixed type, and potentially process it further. In this example, we'll
* simply log the count of modules if it's an array.
*
* @param mixed $modules The modules array or other mixed data passed by the hook.
*/
function my_custom_ult_after_directory_modules_logic( $modules ) {
// Check if the $modules parameter is an array and not empty.
if ( is_array( $modules ) && ! empty( $modules ) ) {
// Log the number of modules found. This is a simple example of using the data.
// In a real-world scenario, you might use this to:
// - Display a custom message to the user.
// - Trigger other actions based on the modules present.
// - Perform administrative tasks.
error_log( 'Ultimate Addons Directory Modules: Found ' . count( $modules ) . ' modules.' );
} elseif ( $modules === null ) {
error_log( 'Ultimate Addons Directory Modules: No modules data was passed.' );
} else {
error_log( 'Ultimate Addons Directory Modules: Received unexpected data type for modules.' );
}
}
// Add the custom function to the 'ult_after_directory_modules' action hook.
// The '10' is the default priority, and '1' indicates that the function accepts 1 argument ($modules).
add_action( 'ult_after_directory_modules', 'my_custom_ult_after_directory_modules_logic', 10, 1 );
?>
Placement
This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.
Source Code
src/templates/admin-modules.php:330
</div>
<?php } ?>
</div>
<?php do_action( 'ult_after_directory_modules', $modules ); ?>
</div>
</div>