Standardize get_*, add_*, delete_*, and update_* function names
|Reported by:||filosofo||Owned by:||anonymous|
|Severity:||normal||Keywords:||deprecated needs-patch functions naming|
Of the approximately 500 or so functions like get_*, add_*, delete_*, and update_*, all except about 20 follow the format of separating each word with underscores, like so: get_attached_file (as opposed to get_attachedfile).
Those 20 that don't make things confusing and should be deprecated. This has already happened to some degree (take a look at the existing functions in wp-includes/deprecated.php).
This is not just a pedantic fix. Is it get_user_meta or get_usermeta, get_post_meta or get_postmeta? (One uses underscores, the other doesn't. I have to look up which is which almost every time I use them, and that's a lot).
To make things more confusing, we have similar-yet-inconsistently-named functions such as update_post_meta and update_postmeta_cache.
Someone may object that some of these are too much a part of WordPress to be changed. Not to worry--they can sit in deprecated.php for a long time, if you want. Besides, it won't be the first time that well-used functions have been deprecated (get_postdata and the user_can* functions, for example).
So please, let's deprecate these while it's early in 2.8 development.
Change History (10)
comment:1 follow-up: ↓ 2 Denis-de-Bernardy — 5 years ago
- Type changed from defect (bug) to enhancement
- Keywords needs-patch added; has-patch removed
- Milestone changed from 2.8 to Future Release