Changeset 9340
- Timestamp:
- 10/25/2008 06:19:42 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-tags.php
r9339 r9340 274 274 <div class="tagcloud"> 275 275 <h3><?php _e('Popular Tags'); ?></h3> 276 <?php wp_tag_cloud( ); ?>276 <?php wp_tag_cloud(array('link' => 'edit')); ?> 277 277 </div> 278 278 -
trunk/wp-includes/category-template.php
r9289 r9340 552 552 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, 553 553 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC', 554 'exclude' => '', 'include' => '' 554 'exclude' => '', 'include' => '', 'link' => 'view' 555 555 ); 556 556 $args = wp_parse_args( $args, $defaults ); … … 562 562 563 563 foreach ( $tags as $key => $tag ) { 564 $link = get_tag_link( $tag->term_id ); 564 if ( 'edit' == $args['link'] ) 565 $link = get_edit_tag_link( $tag->term_id ); 566 else 567 $link = get_tag_link( $tag->term_id ); 565 568 if ( is_wp_error( $link ) ) 566 569 return false; -
trunk/wp-includes/link-template.php
r9318 r9340 557 557 558 558 return $link; 559 } 560 561 /** 562 * Retrieve edit tag link. 563 * 564 * @since 2.7.0 565 * 566 * @param int $tag_id Tag ID 567 * @return string 568 */ 569 function get_edit_tag_link( $tag_id = 0 ) { 570 $tag = get_term($tag_id, 'post_tag'); 571 572 if ( !current_user_can('manage_categories') ) 573 return; 574 575 $location = admin_url('edit-tags.php?action=edit&tag_ID=') . $tag->term_id; 576 return apply_filters( 'get_edit_tag_link', $location ); 577 } 578 579 /** 580 * Display or retrieve edit tag link with formatting. 581 * 582 * @since 2.7.0 583 * 584 * @param string $link Optional. Anchor text. 585 * @param string $before Optional. Display before edit link. 586 * @param string $after Optional. Display after edit link. 587 * @param int|object $tag Tag object or ID 588 * @return string|null HTML content, if $echo is set to false. 589 */ 590 function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) { 591 $tag = get_term($tag, 'post_tag'); 592 593 if ( !current_user_can('manage_categories') ) 594 return; 595 596 if ( empty($link) ) 597 $link = __('Edit This'); 598 599 $link = '<a href="' . get_edit_tag_link( $tag->term_id ) . '" title="' . __( 'Edit tag' ) . '">' . $link . '</a>'; 600 echo $before . apply_filters( 'edit_tag_link', $link, $tag->term_id ) . $after; 559 601 } 560 602 … … 717 759 * @param string $before Optional. Display before edit link. 718 760 * @param string $after Optional. Display after edit link. 719 * @param bool $echo Optional, defaults to true. Whether to echo or return HTML.720 761 * @return string|null HTML content, if $echo is set to false. 721 762 */ 722 function edit_comment_link( $link = 'Edit This', $before = '', $after = '' , $echo = true) {763 function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) { 723 764 global $comment, $post; 724 765 … … 733 774 734 775 $link = '<a href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>'; 735 $link = $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after; 736 if ( $echo ) 737 echo $link; 738 else 739 return $link; 776 echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after; 740 777 } 741 778
Note: See TracChangeset
for help on using the changeset viewer.