Menus: Replace http with https in placeholders.
Encourage the use of https with the placeholder text in menus. Fixes #46312 Props aksl95, audrasjb, celloexpressions, SergeyBiryukov, jorbin. Built from https://develop.svn.wordpress.org/trunk@46330 git-svn-id: http://core.svn.wordpress.org/trunk@46129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1d334b273e
commit
c034f5b4c3
|
@ -292,7 +292,7 @@ function wp_nav_menu_item_link_meta_box() {
|
||||||
<input type="hidden" value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" />
|
<input type="hidden" value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" />
|
||||||
<p id="menu-item-url-wrap" class="wp-clearfix">
|
<p id="menu-item-url-wrap" class="wp-clearfix">
|
||||||
<label class="howto" for="custom-menu-item-url"><?php _e( 'URL' ); ?></label>
|
<label class="howto" for="custom-menu-item-url"><?php _e( 'URL' ); ?></label>
|
||||||
<input id="custom-menu-item-url" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-url]" type="text" class="code menu-item-textbox" value="http://" />
|
<input id="custom-menu-item-url" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-url]" type="text" class="code menu-item-textbox" placeholder="https://" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p id="menu-item-name-wrap" class="wp-clearfix">
|
<p id="menu-item-name-wrap" class="wp-clearfix">
|
||||||
|
@ -918,7 +918,7 @@ function wp_save_nav_menu_items( $menu_id = 0, $menu_data = array() ) {
|
||||||
// And item type either isn't set.
|
// And item type either isn't set.
|
||||||
! isset( $_item_object_data['menu-item-type'] ) ||
|
! isset( $_item_object_data['menu-item-type'] ) ||
|
||||||
// Or URL is the default.
|
// Or URL is the default.
|
||||||
in_array( $_item_object_data['menu-item-url'], array( 'http://', '' ) ) ||
|
in_array( $_item_object_data['menu-item-url'], array( 'https://', 'http://', '' ) ) ||
|
||||||
! ( 'custom' == $_item_object_data['menu-item-type'] && ! isset( $_item_object_data['menu-item-db-id'] ) ) || // or it's not a custom menu item (but not the custom home page)
|
! ( 'custom' == $_item_object_data['menu-item-type'] && ! isset( $_item_object_data['menu-item-db-id'] ) ) || // or it's not a custom menu item (but not the custom home page)
|
||||||
// Or it *is* a custom menu item that already exists.
|
// Or it *is* a custom menu item that already exists.
|
||||||
! empty( $_item_object_data['menu-item-db-id'] )
|
! empty( $_item_object_data['menu-item-db-id'] )
|
||||||
|
|
|
@ -584,7 +584,7 @@
|
||||||
this.currentMenuControl.addItemToMenu( menuItem );
|
this.currentMenuControl.addItemToMenu( menuItem );
|
||||||
|
|
||||||
// Reset the custom link form.
|
// Reset the custom link form.
|
||||||
itemUrl.val( 'http://' );
|
itemUrl.val( '' ).attr( 'placeholder', 'https://' );
|
||||||
itemName.val( '' );
|
itemName.val( '' );
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -950,7 +950,7 @@
|
||||||
|
|
||||||
processMethod = processMethod || api.addMenuItemToBottom;
|
processMethod = processMethod || api.addMenuItemToBottom;
|
||||||
|
|
||||||
if ( '' === url || 'http://' == url ) {
|
if ( '' === url || 'https://' == url || 'http://' == url ) {
|
||||||
$('#customlinkdiv').addClass('form-invalid');
|
$('#customlinkdiv').addClass('form-invalid');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -962,7 +962,7 @@
|
||||||
$( '.customlinkdiv .spinner' ).removeClass( 'is-active' );
|
$( '.customlinkdiv .spinner' ).removeClass( 'is-active' );
|
||||||
// Set custom link form back to defaults
|
// Set custom link form back to defaults
|
||||||
$('#custom-menu-item-name').val('').blur();
|
$('#custom-menu-item-name').val('').blur();
|
||||||
$('#custom-menu-item-url').val('http://');
|
$( '#custom-menu-item-url' ).val( '' ).attr( 'placeholder', 'https://' );
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1192,7 +1192,7 @@ final class WP_Customize_Nav_Menus {
|
||||||
<input type="hidden" value="custom" id="custom-menu-item-type" name="menu-item[-1][menu-item-type]" />
|
<input type="hidden" value="custom" id="custom-menu-item-type" name="menu-item[-1][menu-item-type]" />
|
||||||
<p id="menu-item-url-wrap" class="wp-clearfix">
|
<p id="menu-item-url-wrap" class="wp-clearfix">
|
||||||
<label class="howto" for="custom-menu-item-url"><?php _e( 'URL' ); ?></label>
|
<label class="howto" for="custom-menu-item-url"><?php _e( 'URL' ); ?></label>
|
||||||
<input id="custom-menu-item-url" name="menu-item[-1][menu-item-url]" type="text" class="code menu-item-textbox" value="http://">
|
<input id="custom-menu-item-url" name="menu-item[-1][menu-item-url]" type="text" class="code menu-item-textbox" placeholder="https://">
|
||||||
</p>
|
</p>
|
||||||
<p id="menu-item-name-wrap" class="wp-clearfix">
|
<p id="menu-item-name-wrap" class="wp-clearfix">
|
||||||
<label class="howto" for="custom-menu-item-name"><?php _e( 'Link Text' ); ?></label>
|
<label class="howto" for="custom-menu-item-name"><?php _e( 'Link Text' ); ?></label>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.3-beta1-46329';
|
$wp_version = '5.3-beta1-46330';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue