WordPress.org

Make WordPress Core

Ticket #46312: 46312.diff

File 46312.diff, 1.2 KB (added by mukesh27, 5 months ago)

Patch. Check is_ssl() function for https also add placeholder for custom link URL

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

    diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php
    index 0539e7f..c869489 100644
    a b function wp_nav_menu_item_link_meta_box() { 
    286286        global $_nav_menu_placeholder, $nav_menu_selected_id;
    287287
    288288        $_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;
     289        $_nav_custom_menu_item_url = is_ssl() ? 'https://' : 'http://';
    289290
    290291        ?>
    291292        <div class="customlinkdiv" id="customlinkdiv">
    292293                <input type="hidden" value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" />
    293294                <p id="menu-item-url-wrap" class="wp-clearfix">
    294295                        <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://" />
     296                        <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="" placeholder="<?php echo $_nav_custom_menu_item_url; ?>" />
    296297                </p>
    297298
    298299                <p id="menu-item-name-wrap" class="wp-clearfix">