Opened 3 months ago
Closed 3 months ago
#9195 closed defect (bug) (fixed)
[BP Tools - Manage Opt-outs] Unable to save Screen Options Pagination value
Reported by: | emaralive | Owned by: | imath |
---|---|---|---|
Milestone: | 14.0.0 | Priority: | normal |
Severity: | normal | Version: | 12.5.1 |
Component: | Administration | Keywords: | has-screenshots has-patch commit |
Cc: |
Description
The issue is the inability to save the Screen Options Pagination value for the BuddyPress Tools Manage Opt-outs page/screen. The issue can be replicated by going to site.url/wp-admin/tools.php?page=bp-optouts
:
- Select Screen Options tab.
- Change the pagination value.
- Click Apply
You should notice that the Pagination default value of 20 remains unchanged (see screenshot - screenshot-win10-me-2024.06.19-06_56_23.png for reference).
The the patch adds a callback and filter hook set-screen-option
, which fixes the issue (see screenshot - screenshot-win10-me-2024.06.19-07_11_33.png).
Attachments (4)
Change History (9)
This ticket was mentioned in PR #320 on buddypress/buddypress by imath.
3 months ago
#1
This avoids code duplication.
Trac ticket: https://buddypress.trac.wordpress.org/ticket/9195
#2
@
3 months ago
- Keywords 2nd-opinion added
Hi @emaralive
Thanks a lot for this new catch. Patch is fine and is in line with the way we deal with the screen options.
I believe we can improve it a bit by avoiding code duplication using one & only one callback function to deal with every BP Admin Screen.
I have tested for Activity and Groups Admin Screen, could you test 9195.02.patch with the Opt-outs one to see if it's also behaving the right way?
Thanks in advance for your help.
#3
@
3 months ago
Hi @imath,
Tested the patch (9195.02.patch) and it works well. However, along the way, I discovered that there is another place where screen pagination doesn't save, .i.e., site.url/wp-admin/tools.php?page=bp-members-invitations
(BP Tools - Manage Invitations) and based on the new central function scheme there should be 2 (two) more entries for filter hooks:
add_filter( 'set_screen_option_tools_page_bp_members_invitations_per_page', 'bp_admin_set_screen_options', 10, 3 ); add_filter( 'set_screen_option_tools_page_bp_members_invitations_network_per_page', 'bp_admin_set_screen_options', 10, 3 );
I'm not sure if you need another ticket or not. Perhaps, you can just slide it into PR #320. Thoughts?
screenshot-win10-me-2024.06.19-06_56_23.png