wp_sitemaps_init
Action HookDescription
Fires when initializing the Sitemaps object. Additional sitemaps should be registered on this hook.Hook Information
File Location |
wp-includes/sitemaps.php
View on GitHub
|
Hook Type | Action |
Line Number | 39 |
Hook Parameters
Type | Name | Description |
---|---|---|
WP_Sitemaps
|
$wp_sitemaps
|
Sitemaps object. |
Usage Examples
Basic Usage
<?php
// Hook into wp_sitemaps_init
add_action('wp_sitemaps_init', 'my_custom_function', 10, 1);
function my_custom_function($wp_sitemaps) {
// Your custom code here
}
Source Code Context
wp-includes/sitemaps.php:39
- How this hook is used in WordPress core
<?php
34 *
35 * @since 5.5.0
36 *
37 * @param WP_Sitemaps $wp_sitemaps Sitemaps object.
38 */
39 do_action( 'wp_sitemaps_init', $wp_sitemaps );
40 }
41
42 return $wp_sitemaps;
43 }
44
PHP Documentation
<?php
/**
* Fires when initializing the Sitemaps object.
*
* Additional sitemaps should be registered on this hook.
*
* @since 5.5.0
*
* @param WP_Sitemaps $wp_sitemaps Sitemaps object.
*/
Quick Info
- Hook Type: Action
- Parameters: 1
- File: wp-includes/sitemaps.php
Related Hooks
Related hooks will be displayed here in future updates.