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

WordPress Trac noreply at wordpress.org
Tue Apr 23 05:59:08 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 itsananderson):

 * cc: will@… (added)


Comment:

 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_permalink( $foo->ID ); // Implies that we're getting the permalink for
 $foo
 get_the_permalink( $foo->ID ); // Here "_the_" is kinda misleading. Using
 $foo, not $post
 }}}


 Now, what if we made a new get_the_permalink, defined as:

 {{{
 function get_the_permalink() {
     global $post;
     return get_permalink( $post->ID );
 }
 }}}

 I could see a similar argument for also doing this with other template
 tags. Have "get_the_title" call a "get_title" function, etc. This is,
 however, probably outside the scope of this ticket.

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


More information about the wp-trac mailing list