post_type_archive_link
Filter HookDescription
Filters the post type archive permalink.Hook Information
File Location |
wp-includes/link-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1348 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$link
|
The post type archive permalink. |
string
|
$post_type
|
Post type name. |
Usage Examples
Basic Usage
<?php
// Hook into post_type_archive_link
add_filter('post_type_archive_link', 'my_custom_filter', 10, 2);
function my_custom_filter($link, $post_type) {
// Your custom filtering logic here
return $link;
}
Source Code Context
wp-includes/link-template.php:1348
- How this hook is used in WordPress core
<?php
1343 * @since 3.1.0
1344 *
1345 * @param string $link The post type archive permalink.
1346 * @param string $post_type Post type name.
1347 */
1348 return apply_filters( 'post_type_archive_link', $link, $post_type );
1349 }
1350
1351 /**
1352 * Retrieves the permalink for a post type archive feed.
1353 *
PHP Documentation
<?php
/**
* Filters the post type archive permalink.
*
* @since 3.1.0
*
* @param string $link The post type archive permalink.
* @param string $post_type Post type name.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/link-template.php
Related Hooks
Related hooks will be displayed here in future updates.