[wp-trac] [WordPress Trac] #28425: get_permalink passes only post ID to called functions instead of post object

WordPress Trac noreply at wordpress.org
Wed Jun 25 11:05:10 UTC 2014


#28425: get_permalink passes only post ID to called functions instead of post
object
-------------------------------------------+--------------------------
 Reporter:  arnee                          |       Owner:
     Type:  enhancement                    |      Status:  new
 Priority:  normal                         |   Milestone:  4.0
Component:  Posts, Post Types              |     Version:  trunk
 Severity:  normal                         |  Resolution:
 Keywords:  has-patch dev-feedback commit  |     Focuses:  performance
-------------------------------------------+--------------------------

Comment (by arnee):

 If you are used to work with objects, this mix of using sometimes the ID
 and sometimes passing the object is highly confusing. Another example:


 {{{
 $page = get_post(21278);
 echo get_permalink($page);
 //Will echo http://localhost/wp_svn/adipiscing-at-aliquam/

 $page->post_name="someotherslug";
 echo get_permalink($page);
 //Will echo http://localhost/wp_svn/adipiscing-at-aliquam/
 //Should echo http://localhost/wp_svn/someotherslug/
 }}}

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


More information about the wp-trac mailing list