-
Notifications
You must be signed in to change notification settings - Fork 58
Category_Pager ignores deliberated empty category_base setting #4521
Copy link
Copy link
Open
Description
Describe the bug
In our WordPress setup we have set category_base to an empty string intentional.
This causes an issue with Category_Pager:
| if ( empty( $category_base ) ) { |
If the category_base is an empty string, the class adds "category" to the URL hardcoded.
This means, we have later to fix the created URL:
add_filter( 'paginate_links', function( $link ) {
$link = str_replace( '/category/', '/', $link );
return preg_replace( '/\/$/', '', $link );
}, 10, 1 );
To Reproduce
Steps to reproduce the behavior:
- Go to WordPress settings
- Set category base to an empty string
- Browse Paginated Category pages like example.com/my_category/page/2
- Paginated links contain /category/my_category/page/x
Screenshots
Expected behavior
Category_Pages should respect an empty string as an category_base.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels