-
-
Notifications
You must be signed in to change notification settings - Fork 41
The code "manage_document_revisions_limit" is only loaded with admin usage. Some plugins do not invoke it. #366
Description
Describe the bug
The "manage_document_revisions_limit" code is due to be invoked as part of the "wp_revisions_to_keep" processing and makes by default the number of document revisions to be unlimited.
Since it is logically part of the admin process, it was placed in the admin class module.
During testing of the PP Revisions plugin integration, it was found its scheduling process does not operate with is_admin set to true - and thus the admin code is not invoked - which means the document is treated with the standard number of revisions.
Steps to reproduce the behavior
- Set the system-wide WP_POST_REVISIONS to 1.
- Load WPDR and PublishPress Revisions (and set it to manage documents).
- Create a document with 2 revisions. (As this will be via the admin interface, this will work.)
- Create a new revision using PP Revisions.
- Approve it with a scheduled date in the near future.
- Wait for the time to pass so that the background processing occurs.
Expected behavior
I expect the revision to be integrated with the existing two and so there are 3 revisions.
However the initial two are deleted.
By simply moving the code (and the invocation of the filter) to the main class, this problem is resolved.