I’m writing a plugin that will generate a draft post upon registration of a new user, and set the newly-registered user as the post author. I’m using the latest free version of PR with Paypal gateway enabled and added to my registration form. Registration goes as it should, the user is redirected to Paypal, finishes the payment, and is dropped back at my site. The user is created with no issue, but the post is not being generated.
I’ve tested with PR active, but WITHOUT the Paypal gateway enabled and on the reg form, and that DOES generate the post on registration. I’ve narrowed the issue down to the Paypal being on the reg form.
My code is as follows. Is there another action I need to be using to replace user_register? What is PR doing that’s causing it not to fire correctly?
add_action( 'user_register', 'restaurant_profile_create', 10, 1 );
function restaurant_profile_create( $user_id )
// Get user info
$user_meta = get_user_meta( $user_id, 'pie_text_7', true );
// Create a new post
$user_post = array(
'post_author' => $user_id,
'post_title' => $user_meta,
'post_content' => print_r( $user_meta, true ),
'post_type' => 'post',
// Insert the post into the database
$post_id = wp_insert_post( $user_post );
Thanks for the suggestion! I made the change, but now my form isn’t passing my through to Paypal at all. Paypal gateway is still enabled and set to “live,” and when I edit my form, the Paypal stuff is there. The credit card and Paypal logos are NOT displaying on the live form, and the “Submit” button is creating the user, just not requiring a payment to do so 🙁
Not sure if it’s an update issue or what, but the form edit screen isn’t saving all of the customizations I’ve made anymore. Each time I click away from the edit form screen and come back, it’s back to the default fields 🙁