Changeset 10239
- Timestamp:
- 12/22/2008 07:33:09 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
wp-admin/edit-tag-form.php (modified) (1 diff)
-
wp-admin/edit-tags.php (modified) (8 diffs)
-
wp-admin/includes/template.php (modified) (5 diffs)
-
wp-includes/link-template.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-tag-form.php
r10137 r10239 22 22 <input type="hidden" name="action" value="editedtag" /> 23 23 <input type="hidden" name="tag_ID" value="<?php echo $tag->term_id ?>" /> 24 <input type="hidden" name="taxonomy" value="<?php echo attribute_escape($taxonomy) ?>" /> 24 25 <?php wp_original_referer_field(true, 'previous'); wp_nonce_field('update-tag_' . $tag_ID); ?> 25 26 <table class="form-table"> -
trunk/wp-admin/edit-tags.php
r10150 r10239 12 12 $title = __('Tags'); 13 13 14 wp_reset_vars( array('action', 'tag') ); 14 wp_reset_vars( array('action', 'tag', 'taxonomy') ); 15 16 if ( empty($taxonomy) ) 17 $taxonomy = 'post_tag'; 15 18 16 19 if ( isset( $_GET['action'] ) && isset($_GET['delete_tags']) && ( 'delete' == $_GET['action'] || 'delete' == $_GET['action2'] ) ) … … 26 29 wp_die(__('Cheatin’ uh?')); 27 30 28 $ret = wp_insert_term($_POST['name'], 'post_tag', $_POST);31 $ret = wp_insert_term($_POST['name'], $taxonomy, $_POST); 29 32 if ( $ret && !is_wp_error( $ret ) ) { 30 33 wp_redirect('edit-tags.php?message=1#addtag'); … … 42 45 wp_die(__('Cheatin’ uh?')); 43 46 44 wp_delete_term( $tag_ID, 'post_tag');47 wp_delete_term( $tag_ID, $taxonomy); 45 48 46 49 wp_redirect('edit-tags.php?message=2'); … … 57 60 $tags = $_GET['delete_tags']; 58 61 foreach( (array) $tags as $tag_ID ) { 59 wp_delete_term( $tag_ID, 'post_tag');62 wp_delete_term( $tag_ID, $taxonomy); 60 63 } 61 64 … … 78 81 $tag_ID = (int) $_GET['tag_ID']; 79 82 80 $tag = get_term($tag_ID, 'post_tag', OBJECT, 'edit');83 $tag = get_term($tag_ID, $taxonomy, OBJECT, 'edit'); 81 84 include('edit-tag-form.php'); 82 85 … … 90 93 wp_die(__('Cheatin’ uh?')); 91 94 92 $ret = wp_update_term($tag_ID, 'post_tag', $_POST);95 $ret = wp_update_term($tag_ID, $taxonomy, $_POST); 93 96 94 97 $location = 'edit-tags.php'; … … 168 171 'prev_text' => __('«'), 169 172 'next_text' => __('»'), 170 'total' => ceil(wp_count_terms( 'post_tag') / $tagsperpage),173 'total' => ceil(wp_count_terms($taxonomy) / $tagsperpage), 171 174 'current' => $pagenum 172 175 )); … … 208 211 $searchterms = isset( $_GET['s'] ) ? trim( $_GET['s'] ) : ''; 209 212 210 $count = tag_rows( $pagenum, $tagsperpage, $searchterms );213 $count = tag_rows( $pagenum, $tagsperpage, $searchterms, $taxonomy ); 211 214 ?> 212 215 </tbody> -
trunk/wp-admin/includes/template.php
r10222 r10239 582 582 * @return unknown 583 583 */ 584 function _tag_row( $tag, $class = '' ) {584 function _tag_row( $tag, $class = '', $taxonomy = 'post_tag' ) { 585 585 $count = number_format_i18n( $tag->count ); 586 586 $count = ( $count > 0 ) ? "<a href='edit.php?tag=$tag->slug'>$count</a>" : $count; 587 587 588 588 $name = apply_filters( 'term_name', $tag->name ); 589 $qe_data = get_term($tag->term_id, 'post_tag', object, 'edit');590 $edit_link = "edit-tags.php?action=edit&ta g_ID=$tag->term_id";589 $qe_data = get_term($tag->term_id, $taxonomy, object, 'edit'); 590 $edit_link = "edit-tags.php?action=edit&taxonomy=$taxonomy&tag_ID=$tag->term_id"; 591 591 $out = ''; 592 592 $out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>'; … … 611 611 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 612 612 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 613 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("edit-tags.php?action=delete&ta g_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this tag '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";613 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this tag '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 614 614 $action_count = count($actions); 615 615 $i = 0; … … 653 653 * @return unknown 654 654 */ 655 function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) {655 function tag_rows( $page = 1, $pagesize = 20, $searchterms = '', $taxonomy = 'post_tag' ) { 656 656 657 657 // Get a page worth of tags … … 664 664 } 665 665 666 $tags = get_terms( 'post_tag', $args );666 $tags = get_terms( $taxonomy, $args ); 667 667 668 668 // convert it to table rows … … 670 670 $count = 0; 671 671 foreach( $tags as $tag ) 672 $out .= _tag_row( $tag, ++$count % 2 ? ' class="iedit alternate"' : ' class="iedit"' );672 $out .= _tag_row( $tag, ++$count % 2 ? ' class="iedit alternate"' : ' class="iedit"', $taxonomy ); 673 673 674 674 // filter and send to screen -
trunk/wp-includes/link-template.php
r10213 r10239 570 570 * @return string 571 571 */ 572 function get_edit_tag_link( $tag_id = 0 ) {572 function get_edit_tag_link( $tag_id = 0, $taxonomy = 'post_tag' ) { 573 573 $tag = get_term($tag_id, 'post_tag'); 574 574 … … 576 576 return; 577 577 578 $location = admin_url('edit-tags.php?action=edit&ta g_ID=') . $tag->term_id;578 $location = admin_url('edit-tags.php?action=edit&taxonomy=' . $taxonomy . '&tag_ID=' . $tag->term_id); 579 579 return apply_filters( 'get_edit_tag_link', $location ); 580 580 } … … 1246 1246 1247 1247 /** 1248 * Displaylink to next comments pages.1249 * 1250 * @since 2.7. 01248 * Return the link to next comments pages. 1249 * 1250 * @since 2.7.1 1251 1251 * 1252 1252 * @param string $label Optional. Label for link text. 1253 1253 * @param int $max_page Optional. Max page. 1254 */ 1255 function next_comments_link($label='', $max_page = 0) { 1254 * @return string|null 1255 */ 1256 function get_next_comments_link( $label = '', $max_page = 0 ) { 1256 1257 global $wp_query; 1257 1258 … … 1278 1279 $label = __('Newer Comments »'); 1279 1280 1280 echo '<a href="' . clean_url( get_comments_pagenum_link( $nextpage, $max_page ) ); 1281 $attr = apply_filters( 'next_comments_link_attributes', '' ); 1282 echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1283 } 1284 1285 /** 1286 * Display the previous comments page link. 1281 return '<a href="' . clean_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>'. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1282 } 1283 1284 /** 1285 * Display the link to next comments pages. 1287 1286 * 1288 1287 * @since 2.7.0 1289 1288 * 1289 * @param string $label Optional. Label for link text. 1290 * @param int $max_page Optional. Max page. 1291 */ 1292 function next_comments_link( $label = '', $max_page = 0 ) { 1293 echo get_next_comments_link( $label, $max_page ); 1294 } 1295 1296 /** 1297 * Return the previous comments page link. 1298 * 1299 * @since 2.7.1 1300 * 1290 1301 * @param string $label Optional. Label for comments link text. 1291 * /1292 function previous_comments_link($label='') { 1293 1302 * @return string|null 1303 */ 1304 function get_previous_comments_link( $label = '' ) { 1294 1305 if ( !is_singular() ) 1295 1306 return; … … 1308 1319 $label = __('« Older Comments'); 1309 1320 1310 echo '<a href="' . clean_url(get_comments_pagenum_link($prevpage)); 1311 $attr = apply_filters( 'previous_comments_link_attributes', '' ); 1312 echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1321 return '<a href="' . clean_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1322 } 1323 1324 /** 1325 * Display the previous comments page link. 1326 * 1327 * @since 2.7.0 1328 * 1329 * @param string $label Optional. Label for comments link text. 1330 */ 1331 function previous_comments_link( $label = '' ) { 1332 echo get_previous_comments_link( $label ); 1313 1333 } 1314 1334
Note: See TracChangeset
for help on using the changeset viewer.