0.7.0 — media-library images that render
Added
-
bdox/set-image— point an image element at a media-library attachment so it actually renders, at a named size and with asrcset. The built-in path cannot do this. Measured on Oxygen 6.2.0-beta.2: anOxygenElements\Imagewithfrom: media_libraryandsize: "large"renders the builder's 540×540 grey placeholder whileedit-postreports success and reads the data back exactly as written. The element resolves itssrcascontent.image.media.sizes[size].url, but the MCP schema declaresmediawith onlyid,url,altandadditionalProperties: false, sosizescan never be written and the lookup falls through to|default().attributes.srcsetis unreachable the same way, so an API-created image emits nosrcsetat all.Measured end to end on a probe page: before,
src="data:image/svg+xml…"and one placeholder; after,src="…-1024x640.png"with a five-candidatesrcsetand zero placeholders. An unknown size is the one remaining way to get a placeholder, so it is rejected with the list of real sizes.altneeded its own handling. The element does not rendermedia.altfrom the tree — its template readsget_attachment_alt(media.id)infrom_media_librarymode andcustom_altincustommode, so an attachment without_wp_attachment_image_altrenders an<img>with noaltattribute at all. Passingaltswitches the element to custom mode, andalt_modein the response says when the attachment's own alt is empty.Upstream report: soflyy/agent-connector-for-wp#79
Changed
- New helpers
bdox_pack_get_tree()/bdox_pack_save_tree()/bdox_pack_map_node()._oxygen_datais not the tree — it is an object whose single keytree_json_stringholds the tree as an encoded string, so decoding one level and subscripting['root']yields null.map_nodeis copy-based rather than a reference finder: an aliasing finder previously duplicated whole subtrees across seventeen pages.