get_footer
Action HookDescription
Fires before the footer template file is loaded.Hook Information
File Location |
wp-includes/general-template.php
View on GitHub
|
Hook Type | Action |
Line Number | 82 |
Hook Parameters
Type | Name | Description |
---|---|---|
string|null
|
$name
|
Name of the specific footer file to use. Null for the default footer. |
array
|
$args
|
Additional arguments passed to the footer template. |
Usage Examples
Basic Usage
<?php
// Hook into get_footer
add_action('get_footer', 'my_custom_function', 10, 2);
function my_custom_function($name, $args) {
// Your custom code here
}
Source Code Context
wp-includes/general-template.php:82
- How this hook is used in WordPress core
<?php
77 * @since 5.5.0 The `$args` parameter was added.
78 *
79 * @param string|null $name Name of the specific footer file to use. Null for the default footer.
80 * @param array $args Additional arguments passed to the footer template.
81 */
82 do_action( 'get_footer', $name, $args );
83
84 $templates = array();
85 $name = (string) $name;
86 if ( '' !== $name ) {
87 $templates[] = "footer-{$name}.php";
PHP Documentation
<?php
/**
* Fires before the footer template file is loaded.
*
* @since 2.1.0
* @since 2.8.0 The `$name` parameter was added.
* @since 5.5.0 The `$args` parameter was added.
*
* @param string|null $name Name of the specific footer file to use. Null for the default footer.
* @param array $args Additional arguments passed to the footer template.
*/
Quick Info
- Hook Type: Action
- Parameters: 2
- File: wp-includes/general-template.php
Related Hooks
Related hooks will be displayed here in future updates.