Skip to main content
added 19 characters in body
Source Link
kaiser
  • 50.8k
  • 27
  • 150
  • 244

If you know the ID of the author you can use wp_insert_post specifying the ID and the author ID to it.

$aidi$id = $post->ID; // change this to whathever
$useraidi$user_id = '4'; // change this too

$tehpost$the_post = array();
$tehpost['ID']$the_post['ID'] = $aidi;$id;
$tehpost['post_author']$the_post['post_author'] = $useraidi;$user_id;

wp_insert_post( $tehpost$the_post );

The trick is to specify the ID to update the post. See http://codex.wordpress.org/Function_Reference/wp_insert_postwp_insert_post().

If you know the ID of the author you can use wp_insert_post specifying the ID and the author ID to it.

$aidi = $post->ID; // change this to whathever
$useraidi = '4'; // change this too

$tehpost = array();
$tehpost['ID'] = $aidi;
$tehpost['post_author'] = $useraidi;

wp_insert_post( $tehpost );

The trick is to specify the ID to update the post. See http://codex.wordpress.org/Function_Reference/wp_insert_post

If you know the ID of the author you can use wp_insert_post specifying the ID and the author ID to it.

$id = $post->ID; // change this to whathever
$user_id = '4'; // change this too

$the_post = array();
$the_post['ID'] = $id;
$the_post['post_author'] = $user_id;

wp_insert_post( $the_post );

The trick is to specify the ID to update the post. See wp_insert_post().

edited body
Source Link

If you know the ID of the author you can use wp_insert_post specifying the ID and the author ID to it.

$aidi = $post->ID; // change this to whathever
$useraidi = '4'; // change this too

$tehpost = arraharray();
$tehpost['ID'] = $aidi;
$tehpost['post_author'] = $useraidi;

wp_insert_post( $tehpost );

The trick is to specify the ID to update the post. See http://codex.wordpress.org/Function_Reference/wp_insert_post

If you know the ID of the author you can use wp_insert_post specifying the ID and the author ID to it.

$aidi = $post->ID; // change this to whathever
$useraidi = '4'; // change this too

$tehpost = arrah();
$tehpost['ID'] = $aidi;
$tehpost['post_author'] = $useraidi;

wp_insert_post( $tehpost );

The trick is to specify the ID to update the post. See http://codex.wordpress.org/Function_Reference/wp_insert_post

If you know the ID of the author you can use wp_insert_post specifying the ID and the author ID to it.

$aidi = $post->ID; // change this to whathever
$useraidi = '4'; // change this too

$tehpost = array();
$tehpost['ID'] = $aidi;
$tehpost['post_author'] = $useraidi;

wp_insert_post( $tehpost );

The trick is to specify the ID to update the post. See http://codex.wordpress.org/Function_Reference/wp_insert_post

Source Link

If you know the ID of the author you can use wp_insert_post specifying the ID and the author ID to it.

$aidi = $post->ID; // change this to whathever
$useraidi = '4'; // change this too

$tehpost = arrah();
$tehpost['ID'] = $aidi;
$tehpost['post_author'] = $useraidi;

wp_insert_post( $tehpost );

The trick is to specify the ID to update the post. See http://codex.wordpress.org/Function_Reference/wp_insert_post