Make WordPress Core


Ignore:
Timestamp:
09/19/2005 12:47:58 AM (20 years ago)
Author:
ryan
Message:

Consolidate link forms into edit-link-form

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r2889 r2890  
    518518    $link->link_rss = wp_specialchars($link->link_rss);
    519519   
     520    return $link;
     521}
     522
     523function get_default_link_to_edit() {
     524    if ( isset($_GET['linkurl']) )
     525        $link->link_url = wp_specialchars($_GET['linkurl'], 1);
     526    else
     527        $link->link_url = '';
     528   
     529    if ( isset($_GET['name']) )
     530        $link->link_name = wp_specialchars($_GET['name'], 1);
     531    else
     532        $link->link_name = '';
     533       
    520534    return $link;
    521535}
     
    800814}
    801815
     816function link_category_dropdown($fieldname, $selected = 0) {
     817    global $wpdb;
     818   
     819    $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $wpdb->linkcategories ORDER BY cat_id");
     820    echo "\n<select name='$fieldname' size='1'>\n";
     821    foreach ($results as $row) {
     822        echo "\n\t<option value='$row->cat_id'";
     823        if ($row->cat_id == $selected)
     824            echo " selected='selected'";
     825        echo ">$row->cat_id : " . wp_specialchars($row->cat_name);
     826        if ($row->auto_toggle == 'Y')
     827            echo ' (auto toggle)';
     828        echo "</option>";
     829    }
     830    echo "\n</select>\n";
     831}
     832
    802833function wp_create_thumbnail($file, $max_side, $effect = '') {
    803834
Note: See TracChangeset for help on using the changeset viewer.