month_link
Filter HookDescription
Filters the month archive permalink.Hook Information
File Location |
wp-includes/link-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 608 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$monthlink
|
Permalink for the month archive. |
int
|
$year
|
Year for the archive. |
int
|
$month
|
The month for the archive. |
Usage Examples
Basic Usage
<?php
// Hook into month_link
add_filter('month_link', 'my_custom_filter', 10, 3);
function my_custom_filter($monthlink, $year, $month) {
// Your custom filtering logic here
return $monthlink;
}
Source Code Context
wp-includes/link-template.php:608
- How this hook is used in WordPress core
<?php
603 *
604 * @param string $monthlink Permalink for the month archive.
605 * @param int $year Year for the archive.
606 * @param int $month The month for the archive.
607 */
608 return apply_filters( 'month_link', $monthlink, $year, $month );
609 }
610
611 /**
612 * Retrieves the permalink for the day archives with year and month.
613 *
PHP Documentation
<?php
/**
* Filters the month archive permalink.
*
* @since 1.5.0
*
* @param string $monthlink Permalink for the month archive.
* @param int $year Year for the archive.
* @param int $month The month for the archive.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/link-template.php
Related Hooks
Related hooks will be displayed here in future updates.