Opened 4 years ago
Last modified 3 years ago
#8410 new enhancement
Admin Type order of field for creation of new type
Reported by: | Jean-David | Owned by: | slaFFik |
---|---|---|---|
Milestone: | Awaiting Contributions | Priority: | low |
Severity: | minor | Version: | |
Component: | Administration | Keywords: | has-patch reporter-feedback |
Cc: |
Description
When creating a new Type in Group Type or Member Type in the 7 version of BP, it is confusing to have the first field to be the slug one.
In WordPress, when defining a category, the first one is the name of the category and then the slug is automatically deducted from the name.
I think it would be much mincer to stay in the WP spirit and muscle memory.
https://imgur.com/a/tNFOR6O for example
Attachments (2)
Change History (9)
#2
@
4 years ago
- Keywords needs-patch added; reporter-feedback removed
- Milestone changed from Awaiting Review to Awaiting Contributions
@
4 years ago
As the names are just metadatas, I needed a way to distinguish between the types of the field. I refactored the code into a private function, which is called twice : one before the slug field, and the other after, allowing to filter the field between the "name ones" and the "not name ones"
#3
@
4 years ago
I added a first patch for the ordering of the fields in the BP Type admin feature.
But I'd like to add another patch with the automatic slug from name feature soon.
#4
@
4 years ago
- Keywords has-patch dev-feedback added; needs-patch removed
- Milestone changed from Awaiting Contributions to Awaiting Review
This second patch gives a bp_type_id id not already defined and if the bp_type_singular_name is not empty.
I changed a translation to reflect the changes.
I'd like a code review on the two patches.
#6
@
3 years ago
- Keywords reporter-feedback added; dev-feedback 2nd-opinion removed
Hi thanks for your patches. The first one can be difficult to understand, what about injecting the type's ID into the array of registered meta right after the plural name?
About the 2nd patch: it looks good, but as the type's ID is used by default if no custom slug has been set, the plural name should probably be the value to use so that when the members directory is filtered by a type, the url looks like site.url/members/type/contributors
Hi,
I'm not opposed to reversing the order of these fields and to suggest a Member/Group Type ID according to the singular name. I'd be happy to see a patch about it.