Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feliciaceballos/81e96ec1c2198da062fb2d4e529e7a72 to your computer and use it in GitHub Desktop.
Save feliciaceballos/81e96ec1c2198da062fb2d4e529e7a72 to your computer and use it in GitHub Desktop.
Assign Post to Author in Gravity Forms Dropdown
add_filter( 'gform_post_data_72', 'change_post_type', 10, 3 );
function change_post_type( $post_data, $form, $entry ) {
$convert_user_id = get_user_id_by_display_name($entry[170]);
if ( $form['id'] != 72 ) {
return $post_data;
}
$post_data['post_author'] = $convert_user_id;
return $post_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment