New answers tagged


Short answer - Your original function (mostly) works. This is your function edited to do what it needs to do: function log_me_the_f_in( $user_id ) { wp_set_current_user( $user_id ); wp_set_auth_cookie( $user_id ); wp_redirect( home_url( '/some-ending-page/' ) ); exit(); } add_action( 'user_register', 'log_me_the_f_in' ); Long answer - ...


First add the following code (and probably the WC Test Payment Gateway) and do a test order to get a list of all the data keys that are set in the order process via the woocommerce_after_checkout_validation filter: add_action('woocommerce_after_checkout_validation','custom_modify_order',10,1); function custom_modify_order($posted) { foreach ($posted as ...


Scroll down a little bit, most of it is WordPress default code but you must add everything to your plugin or you might break it! I've also added few useful snippets below. Copy-paste them to same plugin. <?php /* * Plugin Name: Emails * Plugin URI: * Description: Different registration email for different roles * Author: ...


More modern way to do that, it should work even when the wp-login URL is changed by plugins and when WP is in a subfolder, etc: if(stripos($_SERVER["SCRIPT_NAME"], strrchr(wp_login_url(), '/')) !== false){ /* ... */ }

Top 50 recent answers are included