WordPress.org

Make WordPress Core

Changeset 13390


Ignore:
Timestamp:
02/24/2010 10:52:29 PM (12 years ago)
Author:
markjaquith
Message:

Hide URL editing UI for page and category menu items. TODO: eliminate all usage of guid. Use custom field instead. see #11817

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js

    r13377 r13390  
    3434{
    3535
    36         itemTitle = jQuery('#title' + o).attr('value');
    37         itemURL = jQuery('#linkurl' + o).attr('value');
    38         itemAnchorTitle = jQuery('#anchortitle' + o).attr('value');
    39         itemNewWindow = jQuery('#newwindow' + o).attr('value');
    40         itemDesc = jQuery('#description' + o).attr('value');
     36        itemTitle = jQuery('#title' + o).val();
     37        itemURL = jQuery('#linkurl' + o).val();
     38        itemAnchorTitle = jQuery('#anchortitle' + o).val();
     39        itemNewWindow = jQuery('#newwindow' + o).val();
     40        itemDesc = jQuery('#description' + o).val();
    4141
    4242        jQuery('#dialog-confirm').dialog( 'option' , 'itemID' , o )
     
    4444        jQuery('#dialog-confirm').dialog('open');
    4545
    46         jQuery('#edittitle').attr('value', itemTitle);
    47         jQuery('#editlink').attr('value', itemURL);
    48         jQuery('#editanchortitle').attr('value', itemAnchorTitle);
     46        jQuery('#edittitle').val( itemTitle );
     47        if ( 'custom' == jQuery( '#linktype' + o ).val() ) {
     48            jQuery( '#editlink-wrap' ).css( 'display', 'inline' );
     49        } else {
     50            jQuery( '#editlink-wrap' ).css( 'display', 'none' );
     51        }
     52        jQuery('#editlink').val( itemURL );
     53        jQuery('#editanchortitle').val( itemAnchorTitle );
    4954        jQuery("#editnewwindow option[value='" + itemNewWindow  + "']").attr('selected', 'selected');
    50         jQuery('#editdescription').attr('value', itemDesc);
     55        jQuery('#editdescription').val( itemDesc );
    5156
    5257};
  • trunk/wp-admin/nav-menus.php

    r13383 r13390  
    107107        $parent_id = isset( $_POST['parent'.$k] )? $_POST['parent'.$k] : 0;
    108108        $custom_title = isset( $_POST['title'.$k] )?  $_POST['title'.$k] : '';
    109         $custom_linkurl = isset( $_POST['linkurl'.$k] )? $_POST['linkurl'.$k] : '';
     109        $custom_linkurl = ( isset( $_POST['linkurl'.$k] ) && 'custom' == $_POST['linktype'.$k] ) ? $_POST['linkurl'.$k] : '';
    110110        $custom_description = isset( $_POST['description'.$k] )? $_POST['description'.$k] : '';
    111111        // doesn't seem to be used by UI
     
    377377
    378378<div id="dialog-confirm" style="display:none;" title="<?php esc_attr_e('Edit Menu Item'); ?>">
    379     <input id="edittitle" type="text" name="edittitle" value="" /><label class="editlabel" for="edittitle"><?php _e('Menu Title'); ?></label><br />
    380     <input id="editlink" type="text" name="editlink" value="" /><label class="editlabel" for="editlink"><?php _e('URL'); ?></label><br />
    381     <input id="editanchortitle" type="text" name="editanchortitle" value="" /><label class="editlabel" for="editanchortitle"><?php _e('Link Title'); ?></label><br />
     379    <span id="edittitle-wrap"><input id="edittitle" type="text" name="edittitle" value="" /><label class="editlabel" for="edittitle"><?php _e('Menu Title'); ?></label><br /></span>
     380    <span id="editlink-wrap"><input id="editlink" type="text" name="editlink" value="" /><label class="editlabel" for="editlink"><?php _e('URL'); ?></label><br /></span>
     381    <span id="editanchortitle-wrap"><input id="editanchortitle" type="text" name="editanchortitle" value="" /><label class="editlabel" for="editanchortitle"><?php _e('Link Title'); ?></label><br /></span>
     382    <span id="editnewwindow-wrap">
    382383    <select id="editnewwindow" name="editnewwindow">
    383384        <option value="1"><?php _e('Yes'); ?></option>
    384385        <option value="0"><?php _e('No'); ?></option>
    385386    </select><label class="editlabel" for="editnewwindow"><?php _e('Open Link in a new window'); ?></label>
    386     <input id="editdescription" type="text" name="editdescription" value="" <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> /><label class="editlabel" for="editdescription" <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> ><?php _e('Description'); ?></label><br />
     387    </span>
     388    <span id="editdescription-wrap">
     389    <input id="editdescription" type="text" name="editdescription" value="" <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> /><label class="editlabel" for="editdescription" <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> ><?php _e('Description'); ?></label><br /></span>
    387390</div>
    388391
Note: See TracChangeset for help on using the changeset viewer.