diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index d416183f2..0b2ed2cca 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -122,12 +122,12 @@ function fix_attachment_links($post_ID) { return; $i = 0; - $search = "# id=(\"|')p(\d+)\\1#i"; + $search = "#[\s]+rel=(\"|')(.*?)wp-att-(\d+)\\1#i"; foreach ( $anchor_matches[0] as $anchor ) { if ( 0 == preg_match($search, $anchor, $id_matches) ) continue; - $id = $id_matches[2]; + $id = $id_matches[3]; // While we have the attachment ID, let's adopt any orphans. $attachment = & get_post($id, ARRAY_A); @@ -2007,11 +2007,11 @@ function the_attachment_links($id = false) {