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

WordPress Trac noreply at wordpress.org
Wed Mar 5 07:18:28 UTC 2014


#24164: Deprecate `get_permalink()`
-------------------------+------------------
 Reporter:  ericmann     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  3.9
Component:  Permalinks   |     Version:  3.5
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------

Comment (by nacin):

 I'm not one to half-ass it, so here's some empirical data.

 ||= the_* function =||= get_the_* function =||= get_* function =||
 || the_author || get_the_author || ||
 || the_modified_author || get_the_modified_author || ||
 || the_author_meta || get_the_author_meta || ||
 || the_author_link || get_the_author_link || ||
 || the_author_posts || get_the_author_posts || ||
 || the_author_posts_link || '''no getter''' || ||
 || the_category || get_the_category || ''get_category is separate'' ||
 || the_tags || get_the_tags || ''get_tags is separate'' ||
 || the_terms || get_the_terms || ''get_terms is separate'' ||
 || the_title_rss || get_the_title_rss || ||
 || the_content_feed || get_the_content_feed || ||
 || the_excerpt_rss || '''no getter''' || ||
 || the_permalink_rss || '''no getter''' || ||
 || the_category_rss || get_the_category_rss || ||
 || the_date_xml || '''no getter''' || ||
 || the_date || get_the_date '''(similar)''' || ||
 || the_modified_date || get_the_modified_date || ||
 || the_time || get_the_time || ||
 || the_modified_time || get_the_modified_time || ||
 || the_weekday || '''no getter''' || ||
 || the_weekday_date || '''no getter''' || ||
 || the_search_query || '''doesn't follow the pattern''' ||
 get_search_query ||
 || the_generator || get_the_generator || ||
 || the_permalink || '''doesn't follow the pattern''' || get_permalink ||
 || the_feed_link || '''doesn't follow the pattern''' || get_feed_link ||
 || the_shortlink || '''no getter*''' || ||
 || the_title || get_the_title || ||
 || the_title_attribute || '''no getter''' || ||
 || the_guid || get_the_guid || ||
 || the_content || get_the_content || ||
 || the_excerpt || get_the_excerpt || ||
 || the_meta || '''no getter''' || ||
 || the_attachment_link || get_the_attachment_link '''(deprecated)''' || ||
 || the_post_thumbnail || get_the_post_thumbnail || ||
 || the_post || ''(special)'' || ''get_post is separate'' ||
 || the_comment || ''(special)'' || ''get_comment is separate'' ||
 || the_taxonomies || get_the_taxonomies || ||
 || the_widget || '''no getter''' || ||
 Note * — wp_get_shortlink() is a lower level function.

 There are 38 non-deprecated functions in wp-includes that start with
 the_*.
  * Two are the_post() and the_comment(); those don't count for this.
  * 23 have get_the_* equivalents, assuming you count the slightly
 different get_the_date() and the deprecated get_the_attachment_link().
  * 10 have no getter. Of these, few compellingly deserve a getter. For
 example, even though the_title_attribute() is one of the rare ones with
 the ability to pass echo=> false, I could go for
 get_the_title_attribute(), given how often it is used in i18n
 construction.
  * That leaves 3 getters that exist but don't follow the pattern:
 get_search_query(), get_feed_link(), and get_permalink().

 While I could go for aliases for get_the_search_query() and
 get_the_title_attribute(), get_permalink() stands out as the only major
 oddball.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/24164#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list