WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 5 months ago

#35685 new enhancement

Default HTTP schema when adding a custom link

Reported by: isdampe Owned by:
Milestone: Priority: low
Severity: minor Version:
Component: Menus Keywords: has-patch has-ui-feedback
Focuses: ui, administration Cc:
PR Number:

Description

When editing menus in Wordpress (nav-menus.php), the "Custom links" accordion input box always defaults to http://

I feel this should default to https:// if the WP install is running on SSL.

I can't speak for all, but I mostly use custom links for custom links that are already on my site, and if I'm running SSL, then I need to manually change http:// to https:// each time.

Most sites running SSL will only link to other secure sites and resources too, so this may be another point of confirmation.

Attachments (4)

nav-menu.patch (1.0 KB) - added by isdampe 4 years ago.
35685.diff (878 bytes) - added by christophherr 3 years ago.
Removes the default value from the Custom Links URL input field
35685-2.diff (1.8 KB) - added by christophherr 3 years ago.
Updated patch removes the default value from the Custom Links URL input field from Appearance - Menus and Appearance - Customize - Menus interactions
35685.2.diff (1.8 KB) - added by christophherr 3 years ago.

Download all attachments as: .zip

Change History (11)

@isdampe
4 years ago

#1 @Clorith
4 years ago

I wonder if the default value should perhaps be filterable at this point, as core becomes more open to interactions outside of the normal URL scope?

Creating a filter like wp_nav_menu_default_prefix might be an idea here, and also escaping the value before outputting it in the form.

#2 @johnbillion
4 years ago

  • Keywords needs-patch added
  • Priority changed from normal to low
  • Severity changed from normal to minor
  • Version 4.4 deleted

The current URL's scheme is not relevant to the home URL scheme (for example, sites that use FORCE_ADMIN_SSL but don't serve the front end over HTTPS).

My preference here would be to remove the default value entirely.

@christophherr
3 years ago

Removes the default value from the Custom Links URL input field

#3 @christophherr
3 years ago

  • Focuses ui added
  • Keywords has-patch ui-feedback added; needs-patch removed

The uploaded 35685.diff removes the default value.
I guess the UI change needs some feedback.

#4 @karmatosed
3 years ago

  • Keywords has-ui-feedback added; ui-feedback removed

@christophherr I agree that removing the default all together works. However, I notice it's only been removed through Appearance > Menus. It should also be removed in the Customizer menu interactions. If that can happen, I would agree this is ready to consider for commit, thanks.

@christophherr
3 years ago

Updated patch removes the default value from the Custom Links URL input field from Appearance - Menus and Appearance - Customize - Menus interactions

#5 @christophherr
3 years ago

Thank you, @karmatosed.

I attached an updated patch that removes the default value from the Customizer menu interactions as well.

#6 @karmatosed
3 years ago

@christophherr unfortunately I don't seem to be able to get the patch to work. Could you check the patch again, please?

#7 @christophherr
3 years ago

Sorry about that.
I only tested with svn patch not with grunt patch.
I uploaded a new patch through grunt upload_patch.
It applies for me now with svn patch and grunt patch.

Note: See TracTickets for help on using tickets.