Extra Sidebar Widgets: improve Image widget for usability. #6013

Merged
merged 2 commits into from Jan 3, 2017
@lancewillett
Member
  1. Provide context for height and width values expected (pixels).
  2. Improve error message for invalid or missing image URL.

Syncs r148073-wpcom and r148074-wpcom

Testing instructions:

  • Enable the Image widget, check the labels for Height and Width (they should say "in pixels").
  • Save the widget without an image URL, and check the Customizer or front-end output for the following error message, only to logged-in authors: "Image missing or invalid URL. Please check the Image widget URL in your widget settings."
@lancewillett lancewillett requested a review from eliorivero Dec 29, 2016
modules/widgets/image-widget.php
@@ -103,6 +103,10 @@ public function widget( $args, $instance ) {
</figure>'; // wp_kses_post caption on update
}
echo '<div class="jetpack-image-container">' . do_shortcode( $output ) . '</div>';
+ } else {
+ if ( current_user_can('edit_theme_options') ) {
@dereksmart
dereksmart Jan 3, 2017 Member

missing whitespace in parenths

@lancewillett
lancewillett Jan 3, 2017 Member

Thanks, fixed.

@dereksmart dereksmart added this to the 4.5 milestone Jan 3, 2017
@dereksmart dereksmart merged commit 6a92104 into master Jan 3, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@dereksmart
Member

merged to 4.5 1d4752e

@dereksmart dereksmart deleted the update/image-widget branch Jan 3, 2017
@jeherve jeherve added a commit that referenced this pull request Jan 9, 2017
@jeherve jeherve Changelog: add #6013 de0c2bc
@jeherve jeherve added a commit that referenced this pull request Jan 12, 2017
@jeherve jeherve Changelog: add #6013 056d33a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment