﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
22353,"in function wp_publish_post, make it call the wp_update_post",wordpressplugindeveloper,,"
If the post is submitted by role who cannot publish posts, the post will be pending by default and the post name will be empty.

We have a custom posts management interface to approve pending posts.

We use wp_publish_post to approve posts.

Sadly, we find out the approved posts don't have post slug.

So I just wonder will it be better if it can call wp_update_post to handle post status update. 

Just my 2 cents. 

Thanks for your hard work on wordpress!




{{{
function wp_publish_post($post_id) {
	global $wpdb;

	$post = get_post($post_id);

	if ( empty($post) )
		return;

	if ( 'publish' == $post->post_status )
		return;

	$old_status = $post->post_status;
	$post->post_status = 'publish';

	wp_update_post($post);
	
	wp_transition_post_status('publish', $old_status, $post);

	do_action('edit_post', $post_id, $post);
	do_action('save_post', $post_id, $post);
	do_action('wp_insert_post', $post_id, $post);
}
}}}",enhancement,closed,normal,,General,3.5,trivial,invalid,,
