Changeset 7162 for trunk/wp-admin/includes/post.php
- Timestamp:
- 03/05/2008 10:09:28 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/post.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r7146 r7162 582 582 } 583 583 584 function get_sample_permalink($id, $title , $name = null) {584 function get_sample_permalink($id, $title=null, $name = null) { 585 585 $post = &get_post($id); 586 586 if (!$post->ID) { … … 590 590 $original_date = $post->post_date; 591 591 $original_name = $post->post_name; 592 $original_title = $post->post_title; 593 594 $post->post_title = $title; 595 $post->post_name = sanitize_title($post->post_name? $post->post_name : $post->post_title, $post->ID); 596 592 593 // Hack: get_permalink would return ugly permalink for 594 // drafts, so we will fake, that our post is published 597 595 if (in_array($post->post_status, array('draft', 'pending'))) { 598 596 $post->post_status = 'publish'; 599 597 $post->post_date = date('Y-m-d H:i:s'); 600 } 598 $post->post_name = sanitize_title($post->post_name? $post->post_name : $post->post_title, $post->ID); 599 } 600 601 // If the user wants to set a new name -- override the current one 602 // Note: if empty name is supplied -- use the title instead, see #6072 601 603 if (!is_null($name)) { 602 $post->post_name = sanitize_title($name? $name : $ post->post_title, $post->ID);604 $post->post_name = sanitize_title($name? $name : $title, $post->ID); 603 605 } 604 606
Note: See TracChangeset
for help on using the changeset viewer.