Make WordPress Core

Ticket #46312: 46312.3.diff

File 46312.3.diff, 2.5 KB (added by audrasjb, 6 years ago)

Adds https to both menus and customizer, replaces value withplaceholder and updates the custom link check

  • src/wp-admin/includes/nav-menu.php

    diff --git a/src/wp-admin/includes/nav-menu.php b/src/wp-admin/includes/nav-menu.php
    index 0539e7f..d85bcf5 100644
    a b function wp_nav_menu_item_link_meta_box() { 
    292292                <input type="hidden" value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" />
    293293                <p id="menu-item-url-wrap" class="wp-clearfix">
    294294                        <label class="howto" for="custom-menu-item-url"><?php _e( 'URL' ); ?></label>
    295                         <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://" />
     295                        <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://" />
    296296                </p>
    297297
    298298                <p id="menu-item-name-wrap" class="wp-clearfix">
    function wp_save_nav_menu_items( $menu_id = 0, $menu_data = array() ) { 
    894894                                        // And item type either isn't set.
    895895                                        ! isset( $_item_object_data['menu-item-type'] ) ||
    896896                                        // Or URL is the default.
    897                                         in_array( $_item_object_data['menu-item-url'], array( 'http://', '' ) ) ||
     897                                        in_array( $_item_object_data['menu-item-url'], array( 'https://', 'http://', '' ) ) ||
    898898                                        ! ( '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)
    899899                                        // Or it *is* a custom menu item that already exists.
    900900                                        ! empty( $_item_object_data['menu-item-db-id'] )
  • src/wp-includes/class-wp-customize-nav-menus.php

    diff --git a/src/wp-includes/class-wp-customize-nav-menus.php b/src/wp-includes/class-wp-customize-nav-menus.php
    index a6bae20..98f219e 100644
    a b final class WP_Customize_Nav_Menus { 
    11871187                                <input type="hidden" value="custom" id="custom-menu-item-type" name="menu-item[-1][menu-item-type]" />
    11881188                                <p id="menu-item-url-wrap" class="wp-clearfix">
    11891189                                        <label class="howto" for="custom-menu-item-url"><?php _e( 'URL' ); ?></label>
    1190                                         <input id="custom-menu-item-url" name="menu-item[-1][menu-item-url]" type="text" class="code menu-item-textbox" value="http://">
     1190                                        <input id="custom-menu-item-url" name="menu-item[-1][menu-item-url]" type="text" class="code menu-item-textbox" placeholder="https://">
    11911191                                </p>
    11921192                                <p id="menu-item-name-wrap" class="wp-clearfix">
    11931193                                        <label class="howto" for="custom-menu-item-name"><?php _e( 'Link Text' ); ?></label>