[wp-trac] [WordPress Trac] #57041: Deprecate `get_page_by_title()` in favour of `WP_Query`

WordPress Trac noreply at wordpress.org
Fri Feb 3 19:01:10 UTC 2023


#57041: Deprecate `get_page_by_title()` in favour of `WP_Query`
-------------------------------+----------------------------
 Reporter:  peterwilsoncc      |       Owner:  peterwilsoncc
     Type:  enhancement        |      Status:  closed
 Priority:  normal             |   Milestone:  6.2
Component:  Posts, Post Types  |     Version:  2.1
 Severity:  normal             |  Resolution:  fixed
 Keywords:  has-patch          |     Focuses:
-------------------------------+----------------------------

Comment (by afragen):

 Just an FYI. I use `get_page_by_title()` in a plugin's constructor. I have
 changed to the recommended WP_Query call and I get an error that
 `is_user_logged_in()` hasn't been defined.

 This doesn't seem optimal.

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


More information about the wp-trac mailing list