[wp-trac] [WordPress Trac] #48008: 'Illegal string offset \'display_name\'',
WordPress Trac
noreply at wordpress.org
Tue Sep 10 17:54:34 UTC 2019
#48008: 'Illegal string offset \'display_name\'',
--------------------------+-----------------------
Reporter: j3gaming | Owner: (none)
Type: defect (bug) | Status: reopened
Priority: normal | Milestone:
Component: Plugins | Version: 5.2.3
Severity: minor | Resolution:
Keywords: | Focuses:
--------------------------+-----------------------
Changes (by garrett-eclipse):
* status: closed => reopened
* resolution: invalid =>
Comment:
Looking into this it appears to be a back-compat issue with the
introduction of the plugin_information API upgrade to 1.2 which expanded
and introduced the `display_name` into the response.
Specifically [https://core.trac.wordpress.org/changeset/42631
Changeset#42631] of #43192 for the core change and
[https://meta.trac.wordpress.org/ticket/111 Meta#111] for the API.
Previous to this change if a third-party such as ACF used the plugins_api
filter to replace the response they could just use a username string or
array of username strings like;
`"contributors":"elliotcondon"`
Since the core change the contributors returned are required to be a
dictionary with 'profile', 'avatar' and 'display_name' provided as
follows;
`"contributors":{"elliotcondon":{"profile":"https:\/\/profiles.wordpress.org\/elliotcondon","avatar":"https:\/\/secure.gravatar.com\/avatar\/533079e82e526367047100d8019cb9a7?s=96&d=monsterid&r=g","display_name":"elliotcondon"}`
So I guess the question is, for back-compact, should the loop check if
it's a string or a dictionary for the contributor in the loop and if a
string revert to the old way of providing their name/avatar/link?
Pinging @dd32 for thoughts as he mentioned in #43192 to mention him if
anything came up. I presume other plugins using the plugins_api filter may
also be experiencing this unless they were aware of the 1.2 API upgrade
and change to contributors format.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48008#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list