Opened 9 years ago
Closed 6 years ago
#36248 closed enhancement (wontfix)
Rename from `term_description` to `get_term_description`
Reported by: | sebastian.pisula | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | has-patch close dev-feedback |
Focuses: | template | Cc: |
Description
I think that name of function suggest that function display value.
Attachments (2)
Change History (8)
#1
@
9 years ago
- Component changed from General to Taxonomy
- Focuses template added
- Keywords close added
#2
@
9 years ago
- Keywords has-patch added; close removed
In my patch is in deprecated file:
<?php function term_description( $term = 0, $taxonomy = 'post_tag' ) { _deprecated_function( __FUNCTION__, '4.5', 'get_term_description()' ); return get_term_description( $term, $taxonomy ); }
#3
@
9 years ago
- Keywords close added
With that patch we'd end up with two functions that do exactly the same, for no real reason.
One rule of thumb in WordPress core development is: Code refactoring should not be done just because we can.
See https://make.wordpress.org/core/2011/03/23/code-refactoring/ for more information.
#4
@
9 years ago
We could probably add get_the_term_description()
as an alias (there was a precedent in [27409]) and the_term_description()
as a template tag, although I don't see a need for that either.
See the list of all the_*
and get_the_*
functions in comment:28:ticket:24164 for reference.
Note: See
TracTickets for help on using
tickets.
We can't simply rename a function due to backwards compatibility.
The only option would be a
the_term_description()
function, although I don't see a need for that.