[wp-trac] [WordPress Trac] #57337: Docs: WP Theme class reference properties don't match code

WordPress Trac noreply at wordpress.org
Fri Dec 16 12:49:12 UTC 2022


#57337: Docs: WP Theme class reference properties don't match code
---------------------------+------------------------------
 Reporter:  bertvandepoel  |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Themes         |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  docs
---------------------------+------------------------------

Comment (by costdev):

 Hi @bertvandepoel, thanks for ooening this ticket!

 You should be able to use:

 `wp_get_theme()->get( 'Author' )`
 or
 `wp_get_theme()->display( 'Author', false )`
 ( `$markup = false` )

 The documentation for `__get()` magic method is:
 {{{
 __get() magic method for properties
 formerly returned by current_theme_info()
 }}}

 `current_theme_info()` was deprecated in WordPress 3.4.0, so this magic
 method is just here for BC.

 I'm not sure a change to the documentation is necessary here, as `::get()`
 and ::display()` are the appropriate methods to use.

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


More information about the wp-trac mailing list