Changeset 12198
- Timestamp:
- 11/17/2009 07:25:01 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r12110 r12198 714 714 */ 715 715 function _fix_attachment_links( $post_ID ) { 716 global $_fix_attachment_link_id; 716 717 717 718 $post = & get_post( $post_ID, ARRAY_A ); … … 741 742 742 743 $post_search[$i] = $anchor; 743 $post_replace[$i] = preg_replace( "#href=(\"|')[^'\"]*\\1#e", "stripslashes( 'href=\\1' ).get_attachment_link( $id ).stripslashes( '\\1' )", $anchor ); 744 $_fix_attachment_link_id = $id; 745 $post_replace[$i] = preg_replace_callback( "#href=(\"|')[^'\"]*\\1#", '_fix_attachment_links_replace_cb', $anchor ); 744 746 ++$i; 745 747 } … … 751 753 752 754 return wp_update_post( $post); 755 } 756 757 function _fix_attachment_links_replace_cb($match) { 758 global $_fix_attachment_link_id; 759 return stripslashes( 'href='.$m[1] ).get_attachment_link( $_fix_attachment_link_id ).stripslashes( $m[1] ); 753 760 } 754 761
Note: See TracChangeset
for help on using the changeset viewer.