Some shortcode parameters are not working for some documents
jaredcobb opened this issue · comments
It seems that some of the shortcode parameters (for example height
, width
, zoom
, page
, and a few others) are not consistently working on some documents.
Steps to reproduce:
- Add the following shortcode to a post:
[documentcloud url="https://www.documentcloud.org/documents/2746909-ABCC-List.html" responsive="false" width="400" height="400" page="3" zoom="false" /]
- The plugin will make an API call like so:
https://www.documentcloud.org/api/oembed.json?maxwidth=400&maxheight=400&url=https://www.documentcloud.org/documents/2746909-ABCC-List.html?page=3&zoom=false&responsive=false
- The API response will be:
{
"type": "rich",
"version": "1.0",
"provider_name": "DocumentCloud",
"provider_url": "https://www.documentcloud.org",
"cache_age": 300,
"height": 400,
"width": 400,
"html": "<div class=\"DC-embed DC-embed-document DV-container\"> <div style=\"position:relative;padding-bottom:141.2857142857142%;height:0;overflow:hidden;max-width:100%;\"> <iframe src=\"//www.documentcloud.org/documents/2746909-ABCC-List.html?embed=true&notes=false&page=3&pdf=false&responsive=false&search=false&sidebar=false&text=false&zoom=false\" title=\"ABCC-List (Hosted by DocumentCloud)\" sandbox=\"allow-scripts allow-same-origin allow-popups\" frameborder=\"0\" style=\"position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid #aaa;border-bottom:0;box-sizing:border-box;\"></iframe> </div> </div>"
}
- Note a few things about the
html
value...
- The inline style attribute is set at 100% width and 100% height (even though the JSON response shows 400 x 400.
- The iframe
src
value properly renderszoom=false
however the Zoom slider control will still show up. - The iframe
src
value properly renderspage=3
however the document will not default to Page 3.
Confirmed this is happening for me too on a fresh WP install.