Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: [Assigned] CRED – Question about author field

$
0
0

Hi Caridad,

add_action(‘cred_save_data’, ’my_save_data_action’,10,2);
function my_save_data_action($post_id, $form_data) {
// if a specific form
if ($form_data[‘id’]==474) {

if ( !is_user_logged_in() ) {
wp_insert_post( array(
'ID' => $post_id,
'post_author' => 2 // anonymous
) );
}

}
}

This does not work for me… Form ID is 474 and the anonymous user account is ID #2… I also tried user #1 and that didn't work either.


Viewing all articles
Browse latest Browse all 20145

Trending Articles