[wp-trac] [WordPress Trac] #51318: WP_Sitemaps_Provider protected $name property

WordPress Trac noreply at wordpress.org
Wed Sep 30 06:49:30 UTC 2020


#51318: WP_Sitemaps_Provider protected $name property
-------------------------+------------------------------
 Reporter:  Tkama        |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Sitemaps     |     Version:  5.5.1
 Severity:  major        |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by dd32):

 While I'm not sure why it's marked protected, I'm just noting that if you
 want to make the `$name` property public, you can do so in the subclassed
 provider as PHP allows you to change the visibility, for example:
 https://3v4l.org/QIVCg

 You could also call `wp_register_sitemap_provider( $this->name, $this )`
 within the class through something like `$provider = new
 Similar_Posts_Sitemaps_Provider(); $provider->register_provider();` I
 believe.

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


More information about the wp-trac mailing list