Skip to content

Fix/paginate links warning#2712

Merged
ideadude merged 2 commits intodevfrom
fix/paginate-links-warning
Aug 9, 2024
Merged

Fix/paginate links warning#2712
ideadude merged 2 commits intodevfrom
fix/paginate-links-warning

Conversation

@ideadude
Copy link
Copy Markdown
Member

@ideadude ideadude commented Aug 7, 2024

Description

A user reported this issue in the 7.7 update on wp .org here: https://wordpress.org/support/topic/preg_replace-passing-null-to-parameter-3-subject/#post-17939000

Our code like echo wp_kses_post( paginate_links( ... ) ); would sometimes return warnings if the results of the paginate_links call was empty. This is because wp_kses_post called wp_kses, which calls preg_replace at some point down the line, which expects the content being replaced is not empty.

We now set a variable using paginate_links, then check if that result is non empty before echoing and calling wp_kses_post.

How has this been tested?

Manually loading the memberships and notifications pages of the student dashboard with both pagination and not.

Checklist:

  • This PR requires and contains at least one changelog file.
  • My code has been tested.
  • My code passes all existing automated tests.
  • My code follows the LifterLMS Coding & Documentation Standards.

@ideadude ideadude added this to the Next Available Release milestone Aug 7, 2024
@ideadude ideadude merged commit 95ce07b into dev Aug 9, 2024
@ideadude ideadude deleted the fix/paginate-links-warning branch August 9, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants