author_rewrite_rules
Filter HookDescription
Filters rewrite rules used for author archives. Likely author archives would include `/author/author-name/`, as well as pagination and feed paths for author archives.Hook Information
File Location |
wp-includes/class-wp-rewrite.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1393 |
Hook Parameters
Type | Name | Description |
---|---|---|
string[]
|
$author_rewrite
|
Array of rewrite rules for author archives, keyed by their regex pattern. |
Usage Examples
Basic Usage
<?php
// Hook into author_rewrite_rules
add_filter('author_rewrite_rules', 'my_custom_filter', 10, 1);
function my_custom_filter($author_rewrite) {
// Your custom filtering logic here
return $author_rewrite;
}
Source Code Context
wp-includes/class-wp-rewrite.php:1393
- How this hook is used in WordPress core
<?php
1388 *
1389 * @since 1.5.0
1390 *
1391 * @param string[] $author_rewrite Array of rewrite rules for author archives, keyed by their regex pattern.
1392 */
1393 $author_rewrite = apply_filters( 'author_rewrite_rules', $author_rewrite );
1394
1395 // Pages rewrite rules.
1396 $page_rewrite = $this->page_rewrite_rules();
1397
1398 /**
PHP Documentation
<?php
/**
* Filters rewrite rules used for author archives.
*
* Likely author archives would include `/author/author-name/`, as well as
* pagination and feed paths for author archives.
*
* @since 1.5.0
*
* @param string[] $author_rewrite Array of rewrite rules for author archives, keyed by their regex pattern.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/class-wp-rewrite.php
Related Hooks
Related hooks will be displayed here in future updates.