Changeset 5637
- Timestamp:
- 06/02/2007 02:53:09 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r5545 r5637 122 122 'id' => $cat_id, 123 123 'data' => "<li id='category-$cat_id'><label for='in-category-$cat_id' class='selectit'><input value='$cat_id' type='checkbox' checked='checked' name='post_category[]' id='in-category-$cat_id'/> $cat_name</label></li>" 124 ) ); 125 } 126 $x->send(); 127 break; 128 case 'add-link-category' : // On the Fly 129 if ( !current_user_can( 'manage_categories' ) ) 130 die('-1'); 131 $names = explode(',', $_POST['newcat']); 132 $x = new WP_Ajax_Response(); 133 foreach ( $names as $cat_name ) { 134 $cat_name = trim($cat_name); 135 if ( !$slug = sanitize_title($cat_name) ) 136 die('0'); 137 if ( !$cat_id = category_exists( $cat_name ) ) { 138 $cat_id = wp_insert_term( $cat_name, 'link_category' ); 139 $cat_id = $cat_id['term_id']; 140 } 141 $cat_name = wp_specialchars(stripslashes($cat_name)); 142 $x->add( array( 143 'what' => 'link-category', 144 'id' => $cat_id, 145 'data' => "<li id='link-category-$cat_id'><label for='in-link-category-$cat_id' class='selectit'><input value='$cat_id' type='checkbox' checked='checked' name='link_category[]' id='in-link-category-$cat_id'/> $cat_name</label></li>" 124 146 ) ); 125 147 } -
trunk/wp-admin/edit-link-form.php
r5323 r5637 44 44 <div class="dbx-content"> 45 45 <p id="jaxcat"></p> 46 <ul id=" categorychecklist"><?php dropdown_link_categories(get_option('default_link_category')); ?></ul>46 <ul id="linkcategorychecklist"><?php dropdown_link_categories(get_option('default_link_category')); ?></ul> 47 47 </div> 48 48 </fieldset> -
trunk/wp-admin/includes/bookmark.php
r5566 r5637 14 14 $_POST['link_image'] = wp_specialchars( $_POST['link_image'] ); 15 15 $_POST['link_rss'] = clean_url($_POST['link_rss']); 16 $_POST['link_category'] = $_POST['post_category'];17 16 18 17 if ( !empty( $link_id ) ) { -
trunk/wp-admin/includes/taxonomy.php
r5566 r5637 6 6 7 7 function category_exists($cat_name) { 8 return is_term($cat_name, 'category'); 8 $id = is_term($cat_name, 'category'); 9 if ( is_array($id) ) 10 $id = $id['term_id']; 11 return $id; 9 12 } 10 13 -
trunk/wp-admin/includes/template.php
r5622 r5637 158 158 $name = wp_specialchars( apply_filters('the_category', $category->name)); 159 159 $checked = in_array( $cat_id, $checked_categories ); 160 echo '<li id=" category-', $cat_id, '"><label for="in-category-', $cat_id, '" class="selectit"><input value="', $cat_id, '" type="checkbox" name="post_category[]" id="in-category-', $cat_id, '"', ($checked ? ' checked="checked"' : "" ), '/> ', $name, "</label></li>";160 echo '<li id="link-category-', $cat_id, '"><label for="in-link-category-', $cat_id, '" class="selectit"><input value="', $cat_id, '" type="checkbox" name="link_category[]" id="in-link-category-', $cat_id, '"', ($checked ? ' checked="checked"' : "" ), '/> ', $name, "</label></li>"; 161 161 } 162 162 } -
trunk/wp-admin/link-add.php
r4999 r5637 14 14 wp_enqueue_script( array('xfn', 'dbx-admin-key?pagenow=link.php') ); 15 15 if ( current_user_can( 'manage_categories' ) ) 16 wp_enqueue_script( 'ajax cat' );16 wp_enqueue_script( 'ajaxlinkcat' ); 17 17 require('admin-header.php'); 18 18 ?> -
trunk/wp-admin/link.php
r4499 r5637 94 94 wp_enqueue_script( array('xfn', 'dbx-admin-key?pagenow=link.php') ); 95 95 if ( current_user_can( 'manage_categories' ) ) 96 wp_enqueue_script( 'ajax cat' );96 wp_enqueue_script( 'ajaxlinkcat' ); 97 97 $parent_file = 'link-manager.php'; 98 98 $submenu_file = 'link-manager.php'; -
trunk/wp-includes/script-loader.php
r5631 r5637 110 110 'how' => __('Separate multiple categories with commas.') 111 111 ) ); 112 $this->add( 'ajaxlinkcat', '/wp-admin/js/link-cat.js', array('listman'), '200700601' ); 113 $this->localize( 'ajaxlinkcat', 'linkcatL10n', array( 114 'add' => attribute_escape(__('Add')), 115 'how' => __('Separate multiple categories with commas.') 116 ) ); 112 117 $this->add( 'admin-categories', '/wp-admin/js/categories.js', array('listman'), '3684' ); 113 118 $this->add( 'admin-custom-fields', '/wp-admin/js/custom-fields.js', array('listman'), '3733' );
Note: See TracChangeset
for help on using the changeset viewer.