[wp-trac] [WordPress Trac] #24164: Deprecate `get_permalink()`

WordPress Trac noreply at wordpress.org
Tue Apr 23 17:01:58 UTC 2013


#24164: Deprecate `get_permalink()`
-----------------------------+------------------------------
 Reporter:  ericmann         |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Template         |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |
-----------------------------+------------------------------
Changes (by ethitter):

 * cc: erick@… (added)


Comment:

 Replying to [comment:2 itsananderson]:
 > For what it's worth, get_permalink can be called outside the loop by
 passing a post ID, making the addition of "_the_" somewhat ambiguous.

 `get_the_title()` and `get_the_guid()` both accept an ID, so the use of
 ''the'' already doesn't indicate that an ID is or isn't accepted. The
 ''the_'' and ''get_the_'' conventions simply indicate that functions
 either `echo` or `return` the information they retrieve, and this ticket
 doesn't aim to change that.

 Replying to [comment:3 nacin]:
 > `get_permalink()` is used in probably the vast majority of themes and
 plugins, and is one of the most well-known functions. I'm not sure
 deprecating it is worth the standardization.

 I've trained new WordPress developers at various employers, taught
 WordPress development classes, and presented at WordCamps about how Core
 is organized; this inconsistency is a continual point of confusion in all
 of these situations. After I finish explaining the conventions WordPress
 attempts to adhere to, I must then list a series of exceptions.

 What's the harm in making the changes in ericmann's patch? No action or
 filter tags change, we're simply cleaning up the codebase to introduce
 greater consistency and make it easier for developers to learn WordPress.

 For a site that doesn't have `WP_DEBUG` set to `true`, we're simply adding
 another action call to the hundreds (or thousands) that already fire for
 each request. For a site with `WP_DEBUG` set to `true`, we are adding to
 the noise generated by Core's `_deprecated_*()` and `_doing_it_wrong()`
 functions, but let's be honest, it's already pretty noisy in here.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/24164#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list