0

is it anyway possible to find a home page at all, I would like to insert php code on it, from cms I do not know if it's possible, I watched some plugins, but they do not look good to me. thank you all for help

  • What exactly do you want to achieve? Just add some PHP to the home page, or to every page? Does it have to be at a specific position, or just executed in header or footer? – janh Oct 13 '17 at 7:30
  • I want the user after the registration (when he clicked the button to register) to send one xml containing his data. This xml code has variables in php and the data generated is sent directly to another server. I thought that after the registration I posted a home page, I think that I could put this php code on my home page? – srdjan_stojanovic Oct 13 '17 at 7:38
0

I think using the user_registration hook is probably the best fit for what you want to do.

An example from the docs:

add_action( 'user_register', 'myplugin_registration_save', 10, 1 );

function myplugin_registration_save( $user_id ) {

    if ( isset( $_POST['first_name'] ) )
        update_user_meta($user_id, 'first_name', $_POST['first_name']);

}

To be compliant with the WordPress way (and be less likely to get into trouble if you change servers), you should probably use WP's HTTP API to send the XML to the other URL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.