Ticket #1257: fix-permalink-in-outgoing-pings.diff
File fix-permalink-in-outgoing-pings.diff, 1.3 KB (added by , 19 years ago) |
---|
-
post.php
188 188 189 189 add_meta($post_ID); 190 190 191 // Set the permalink regardless of post status so drafts have a valid link in the preview 191 192 $wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'"); 192 193 193 194 do_action('save_post', $post_ID); 194 195 195 196 if ('publish' == $post_status) { 197 // Bust the post cache to make sure permalinks work 198 global $post_cache; 199 if (isset($post_cache[$post_ID])) 200 unset($post_cache[$post_ID]); 201 202 $wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'"); 203 196 204 do_action('publish_post', $post_ID); 197 205 if ($post_pingback) 198 206 register_shutdown_function('pingback', $content, $post_ID); … … 432 440 do_action('edit_post', $post_ID); 433 441 434 442 if ($post_status == 'publish') { 443 // Bust the post cache to make sure permalinks work 444 global $post_cache; 445 if (isset($post_cache[$post_ID])) 446 unset($post_cache[$post_ID]); 447 448 $wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'"); 449 435 450 do_action('publish_post', $post_ID); 436 451 register_shutdown_function('do_trackbacks', $post_ID); 437 452 register_shutdown_function('do_enclose', $content, $post_ID );