documentcloud / wordpress-documentcloud

Embed DocumentCloud documents that won't be eaten by the visual editor

Home Page:https://wordpress.org/plugins/documentcloud/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow default setting to show/hide sidebar

eyeseast opened this issue · comments

The plugin allows defaults for size, but the sidebar is another frequently used setting. (I always turn it off in posts, for example.)

Any other knobs and dials that should be default-able?

Arguably, all booleans could be. Here's the list of accepted ones:

  • responsive (currently defaults true)
  • sidebar (currently default false)
  • text (currently defaults true)
  • pdf (currently defaults true, although this is made irrelevant by sidebar:false)
  • notes
  • zoom
  • search

'url' => null,
'container' => null,
'notes' => null,
'responsive_offset' => null,
'default_page' => null,
'default_note' => null,
'zoom' => null,
'search' => null,
'responsive' => 'true',
// The following defaults match the existing plugin, except
// `height/width` are prefixed `max*` per the oEmbed spec.
// You can still use `height/width` for backwards
// compatibility, but they'll be mapped to `max*`.
// Precedence (lower number == higher priority):
// 1. `width` on shortcode
// 2. `maxwidth` on shortcode
// 3. Settings > DocumentCloud > "Default embed width"
// 4. `wp_embed_defaults()['width']`
'maxheight' => $default_sizes['height'],
'maxwidth' => $default_sizes['width'],
'format' => 'normal',
'sidebar' => 'false',
'text' => 'true',
'pdf' => 'true',

I think it makes sense to include all of them. Might as well make this easy for people.

👍 You wanna take a crack at it?

I don't much care what the defaults for text/pdf/sidebar are (I just left the existing defaults in), but responsive should default true.

Yeah, can do. I was also going to take a shot at #25 this week or next.

Awesome! I'm about to tag and release v0.4.1 with the VIP conformity and #35. #25 would justify a v0.5.0 release, IMO.