Making WordPress.org

Changeset 12539


Ignore:
Timestamp:
04/13/2023 11:21:17 PM (20 months ago)
Author:
coffee2code
Message:

Photo Directory, Uploads: Reinforce intent of text input as being for alternative text.

  • Rename the field from "Description" to "Alternative Text"
  • Make the field required
  • Increase field's input limit to 350 characters
  • Display the field as a textarea
  • Add help text that explicitly requests that the contents of the photo be described

Props alexstine, otto42, coffee2code.
See #6173.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/assets/js/submit.js

    r12234 r12539  
    112112 */
    113113function photoGetInputFields( form ) {
    114     return form.querySelectorAll( 'input:not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="file"])');
     114    return form.querySelectorAll('textarea, input:not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="file"])');
    115115}
    116116
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/uploads.php

    r12404 r12539  
    1515     * @var int
    1616     */
    17     const MAX_LENGTH_DESCRIPTION = 250;
     17    const MAX_LENGTH_DESCRIPTION = 350;
    1818
    1919    /**
     
    909909                . "</div>\n"
    910910                . sprintf(
    911                     '[%s name="post_content" class="textarea" id="ug_content" description="%s" maxlength="%d" help="%s"]' . "\n",
     911                    '[%s name="post_content" class="textarea" id="ug_content" description="%s" required="required" aria-required="true" maxlength="%d" help="%s"]' . "\n",
    912912                    $description_shortcode,
    913                     esc_attr( __( 'Description (optional)', 'wporg-photos' ) ),
     913                    esc_attr( __( 'Alternative Text (required)', 'wporg-photos' ) ),
    914914                    self::MAX_LENGTH_DESCRIPTION,
    915                     esc_attr( sprintf( __( 'Maximum of %d characters. No HTML.', 'wporg-photos' ), self::MAX_LENGTH_DESCRIPTION ) )
     915                    esc_attr( sprintf( __( 'Describe what can be seen in the photo for the benefit of those without sight. May be edited by moderators. Maximum of %d characters. No HTML.', 'wporg-photos' ), self::MAX_LENGTH_DESCRIPTION ) )
    916916                )
    917917                . '<div class="upload-checkbox-wrapper">' . "\n";
Note: See TracChangeset for help on using the changeset viewer.