Make WordPress Core


Ignore:
Timestamp:
08/08/2008 05:05:10 PM (17 years ago)
Author:
westi
Message:

Lots of fixes for Notices when WP_DEBUG is set. See #6669 props santosj.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-link-form.php

    r8025 r8589  
    1515    global $link;
    1616
    17     $link_rel = $link->link_rel;
     17    $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
    1818    $rels = preg_split('/\s+/', $link_rel);
    1919
     
    9393<h3><label for="link_description"><?php _e('Description') ?></label></h3>
    9494<div class="inside">
    95     <input type="text" name="link_description" size="30" tabindex="1" value="<?php echo $link->link_description; ?>" id="link_description" /><br />
     95    <input type="text" name="link_description" size="30" tabindex="1" value="<?php echo ( isset( $link->link_description ) ? $link->link_description : ''); ?>" id="link_description" /><br />
    9696    <?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?>
    9797</div>
     
    117117<div id="categories-all" class="ui-tabs-panel">
    118118    <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
    119         <?php wp_link_category_checklist($link->link_id); ?>
     119        <?php
     120        if ( isset($link->link_id) )
     121            wp_link_category_checklist($link->link_id);
     122        else
     123            wp_link_category_checklist();
     124        ?>
    120125    </ul>
    121126</div>
     
    138143<fieldset><legend class="hidden"><?php _e('Target') ?></legend>
    139144<label for="link_target_blank" class="selectit">
    140 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo(($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
     145<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
    141146<code>_blank</code></label><br />
    142147<label for="link_target_top" class="selectit">
    143 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo(($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
     148<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
    144149<code>_top</code></label><br />
    145150<label for="link_target_none" class="selectit">
    146 <input id="link_target_none" type="radio" name="link_target" value="" <?php echo(($link->link_target == '') ? 'checked="checked"' : ''); ?> />
     151<input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> />
    147152<?php _e('none') ?></label>
    148153</fieldset>
     
    157162    <tr>
    158163        <th style="width: 20%;" scope="row"><label for="link_rel"><?php _e('rel:') ?></label></th>
    159         <td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo $link->link_rel; ?>" /></td>
     164        <td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo ( isset( $link->link_rel ) ? $link->link_rel : ''); ?>" /></td>
    160165    </tr>
    161166    <tr>
     
    270275    <tr class="form-field">
    271276        <th valign="top"  scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
    272         <td><input type="text" name="link_image" id="link_image" size="50" value="<?php echo $link->link_image; ?>" style="width: 95%" /></td>
     277        <td><input type="text" name="link_image" id="link_image" size="50" value="<?php echo ( isset( $link->link_image ) ? $link->link_image : ''); ?>" style="width: 95%" /></td>
    273278    </tr>
    274279    <tr class="form-field">
    275280        <th valign="top"  scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>
    276         <td><input name="link_rss" type="text" id="rss_uri" value="<?php echo $link->link_rss; ?>" size="50" style="width: 95%" /></td>
     281        <td><input name="link_rss" type="text" id="rss_uri" value="<?php echo  ( isset( $link->link_rss ) ? $link->link_rss : ''); ?>" size="50" style="width: 95%" /></td>
    277282    </tr>
    278283    <tr class="form-field">
    279284        <th valign="top"  scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
    280         <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo $link->link_notes; ?></textarea></td>
     285        <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo  ( isset( $link->link_notes ) ? $link->link_notes : ''); ?></textarea></td>
    281286    </tr>
    282287    <tr class="form-field">
     
    286291            for ($r = 0; $r < 10; $r++) {
    287292                echo('            <option value="'.$r.'" ');
    288                 if ($link->link_rating == $r)
     293                if ( isset($link->link_rating) && $link->link_rating == $r)
    289294                    echo 'selected="selected"';
    290295                echo('>'.$r.'</option>');
Note: See TracChangeset for help on using the changeset viewer.