Making WordPress.org

Changeset 11690


Ignore:
Timestamp:
03/21/2022 10:07:45 PM (2 years ago)
Author:
coffee2code
Message:

Photo Directory, Uploads: Move file upload input field to top of submit form.

Better to front-load required fields (which file upload is), whereas description (which previously appeared before it) was optional. And it makes better sense to progress from picking/seeing the photo and then describing it.

Props topher1kenobe.
Fixes #6092.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/uploads.php

    r11679 r11690  
    724724                $content .= '[input type="hidden" name="post_title" value=""]' . "\n";
    725725                $content .= sprintf(
     726                    '[input type="file" name="ug_photo" id="ug_photo" description="%s" required="true" aria-required="true"]' . "\n",
     727                    esc_attr( __( 'Photo', 'wporg-photos' ) )
     728                )
     729                . sprintf(
    726730                    '[%s name="post_content" class="textarea" id="ug_content" description="%s" maxlength="%d" help="%s"]' . "\n",
    727731                    $description_shortcode,
     
    729733                    self::MAX_LENGTH_DESCRIPTION,
    730734                    esc_attr( sprintf( __( 'Maximum of %d characters.', 'wporg-photos' ), self::MAX_LENGTH_DESCRIPTION ) )
    731                 )
    732                 . sprintf(
    733                     '[input type="file" name="ug_photo" id="ug_photo" description="%s" required="true" aria-required="true"]' . "\n",
    734                     esc_attr( __( 'Photo', 'wporg-photos' ) )
    735735                )
    736736                . '<div class="upload-checkbox-wrapper">' . "\n";
Note: See TracChangeset for help on using the changeset viewer.