Make WordPress Core

Opened 11 years ago

Closed 8 years ago

#36248 closed enhancement (wontfix)

Rename from `term_description` to `get_term_description`

Reported by: sebastian.pisula Owned by:
Priority: normal Milestone:
Component: Taxonomy Version:
Severity: normal Keywords: has-patch close dev-feedback
Cc: Focuses: template

Description

I think that name of function suggest that function display value.

Attachments (2)

36248.patch​ (1.9 KB ) - added by sebastian.pisula 11 years ago.
362481.patch​ (2.9 KB ) - added by sebastian.pisula 11 years ago.

Download all attachments as: .zip

Change History (8)

#1 @swissspidy
11 years ago

  • Component General → Taxonomy
  • Focuses template added
  • Keywords close added

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.

#2 @sebastian.pisula
11 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 @swissspidy
11 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 @SergeyBiryukov
11 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.

#5 @swissspidy
10 years ago

  • Keywords dev-feedback added

#6 @boonebgorges
8 years ago

  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status new → closed

Closing based on the arguments above.

Note: See TracTickets for help on using tickets.