Skip to content

Feature Request: Add Filter to Disable remove_page_number() #110

@kristaleemcphee

Description

@kristaleemcphee

We're running into an issue with pagination on a custom archive page (/news/press/page/2) where the page number is being stripped from the URL, which breaks the pagination functionality.

After reviewing the code, it looks like this line in includes/class-custom-permalinks-frontend.php (around line 727) is the source of the behavior:

$request = $this->remove_page_number( $request );

We’d like to request a filter be added to optionally disable this line, something like:

if ( ! apply_filters( 'custom_permalinks_disable_remove_page_number', false ) ) {
    $request = $this->remove_page_number( $request );
}
  • It keeps the current functionality intact for most users
  • It gives developers flexibility in edge cases (like custom archive pagination)
  • It’s a low-maintenance solution and would allow us to continue using the plugin without modifying core files

Please let me know if this is something you’d be open to adding.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions