Opened 4 years ago
Closed 4 years ago
#8362 closed defect (bug) (fixed)
View buttons can be incorrectly visible on Pages settings
Reported by: | johnjamesjacoby | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 7.0.0 | Priority: | normal |
Severity: | minor | Version: | 2.0 |
Component: | Settings | Keywords: | has-patch |
Cc: |
Description
On my local installation, in Settings > BuddyPress > Pages, I am seeing "View" buttons even though each component has "None" selected.
Screen shot imminent.
Attachments (2)
Change History (6)
#3
@
4 years ago
1.patch adds a get_post()
check to the condition that decides whether to show the "View" button. This function call will usually come at no additional cost, because wp_dropdown_pages()
will have already cached those IDs.
A more complex approach to avoiding cache misses would involve a change to bp_core_get_directory_page_ids()
instead, to use get_blog_post()
(or some BuddyPress abstraction) to remove missing pages from its results.
I kinda think both changes would be good ones, but I think it's OK to make sure the UI is correct first and determine if a deeper change can be done without breaking anything else later.
This happens if the
bp-pages
option exists and has pages in it, but those pages are trashed and deleted after BuddyPress is deactivated. The pages are gone, but the option remains with those pages inside of it.Patch imminent.