Opened 4 years ago
Closed 4 years ago
#8339 closed defect (bug) (fixed)
Codebase language improvements for a better contributors inclusivity
Reported by: | imath | Owned by: | imath |
---|---|---|---|
Milestone: | 7.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | dev-feedback |
Cc: |
Description
In WP 5.5, contributors have started to avoid using sensible terms (eg: "black", "white") into the WordPress Codebase: https://make.wordpress.org/core/2020/07/23/codebase-language-improvements-in-5-5/
I believe we should do the same starting with these two terms.
Attachments (2)
Change History (11)
#2
@
4 years ago
- Keywords dev-feedback added; needs-patch removed
In [12694] I made the easy changes.
The remaining instances are a bit more complicated, so I was hoping for review or feedback before moving forward.
BP_XProfile_Field_Type
See 8339-xprofile.diff.
This class has a method set_whitelist_values()
, a filter 'bp_xprofile_field_type_set_whitelist_values'
and a property validation_whitelist
.
- I've changed the method to
set_allowed_values()
, and changedset_whitelist_values()
to a wrapper that calls_deprecated_function()
. - I wrapped the old filter in
apply_filters_deprecated()
and added a new, appropriately-named filter. - The property is the tricky bit. I renamed it to
validation_allowed_values
. This could break compatibility if aBP_XProfile_Field_Type
extending class references the protectedvalidation_whitelist
property. I thought about a magic__get()
but this will cause visibility issues, since the property should beprotected
and__get()
will make itpublic
. Our own core field types do *not* directly referencevalidation_whitelist
- we only use the wrapper methods - so I think it's very unlikely that any plugins do so either, which means that this is probably an acceptable break.
Activity and core keyword moderation
See 8339-activity.diff.
The language in WP is 'disallowed keys', so that's what I've used throughout.
A few function names contained blacklist
. I deprecated them in 7.0.php
. As above, I also deprecated filters, and added new ones with more appropriate names.
[12694] already contains the necessary changes to accommodate the new disallowed_keys
option in WP. See https://buddypress.trac.wordpress.org/changeset/12694/trunk/src/bp-core/bp-core-moderation.php
This ticket was mentioned in Slack in #buddypress by boone. View the logs.
4 years ago
#5
@
4 years ago
@boonebgorges I just had a look to 8339-xprofile.diff
& 8339-activity.diff
. They looks good to me. About the last one, FYI the 7.0.php file is missing into the patch ;)
#6
@
4 years ago
Thanks, @imath !
Re 8339-activity.diff - I first generated it without the 7.0.php file, realized my error, then regenerated the diff, but forgot to upload it again :-/
In 12694: