WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#20706 new enhancement

Adding a link without a name or web address yields no (error) feedback

Reported by: AVReidy Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version:
Component: General Keywords: has-patch dev-feedback
Focuses: Cc:

Description

If a user successfully creates a link (on link-add.php), the user receives the message "Link added." However, there are no measures taken to notify the user if the link was not successfully added.

Links are not added when the link name and web address fields are left blank, so I have included a little patch to let the user know when this occurs.

This could be done with some JavaScript form validation that makes an alert box pop up, but half the (PHP/HTML) code was already present for this, and I think it looks better this way, personally. This is my first attempt at submitting a patch to any open source project, so I appreciate your feedback. Thanks!

Attachments (3)

edit-link-form.php.patch (864 bytes) - added by AVReidy 2 years ago.
link.php.patch (399 bytes) - added by AVReidy 2 years ago.
20706.patch (1.1 KB) - added by SergeyBiryukov 2 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 follow-up: kawauso2 years ago

edit-link-form.php.patch needs to retain i18n support with _e() or __()

Also both patches should be generated with paths given relative to root.

comment:2 in reply to: ↑ 1 AVReidy2 years ago

Replying to kawauso:

edit-link-form.php.patch needs to retain i18n support with _e() or __()

Also both patches should be generated with paths given relative to root.

Thanks for the feedback, kawauso. I replaced the echo functions with _e(), and I regenerated the patches from the root directory.

Version 1, edited 2 years ago by AVReidy (previous) (next) (diff)

AVReidy2 years ago

AVReidy2 years ago

SergeyBiryukov2 years ago

comment:3 AVReidy2 years ago

Thanks Sergey. Still getting used to the coding standards.

Note: See TracTickets for help on using tickets.