[buddypress-trac] [BuddyPress Trac] #6549: xprofile field type for phone number

buddypress-trac noreply at wordpress.org
Mon Feb 5 17:41:08 UTC 2018


#6549: xprofile field type for phone number
------------------------------+-----------------------
 Reporter:  danbp             |       Owner:  DJPaul
     Type:  enhancement       |      Status:  assigned
 Priority:  normal            |   Milestone:  3.0
Component:  Extended Profile  |     Version:  2.3.2
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |
------------------------------+-----------------------

Comment (by boonebgorges):

 This is neat. I didn't know about `tel://`.

 What is the purpose of the `-1` here?
 https://github.com/paulgibbs/bptemp/compare/6549-phone-number#diff-
 4b65738138aa6b4805151204f4f9e6bfR68 Should this be dynamic, in case
 there's more than one field of the type? There's a couple more hardcoded
 suffixes later in the same method too.

 When concatenating regex I usually use `preg_quote()`. Probably doesn't
 matter here because of the limiter character set of the `scheme`, but
 might be a best practice. https://github.com/paulgibbs/bptemp/compare/6549
 -phone-number#diff-4b65738138aa6b4805151204f4f9e6bfR138

 A question: I can imagine a site owner wanting to implement stricter
 validation, such as forcing the phone number format of a given country.
 This can be done pretty well with a client-side library, so maybe it's not
 relevant here. Do you think it's also worth considering a more obvious way
 to do that here as well, without having to register a new field type? I
 guess this'd be a filter on the format?
 https://github.com/paulgibbs/bptemp/compare/6549-phone-number#diff-
 4b65738138aa6b4805151204f4f9e6bfR31 This suggestion might be
 overengineering/overthinking.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6549#comment:4>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list