Get the password key when using the wp_new_user_notification_email filter

I found a function to retrieve this key : get_password_reset_key(). So now I have this code in my plugin to customize the email sent to newly registered users: add_filter(‘wp_new_user_notification_email’, ‘change_notification_message’, 10, 3); function change_notification_message( $wp_new_user_notification_email, $user, $blogname ) { // Generate a new key $key = get_password_reset_key( $user ); // Set the subject $wp_new_user_notification_email[‘subject’] = … Read more

How do you render_callback for register_block_type to a method in another class?

Option 1 is the solution, here’s a smaller example: $obj = new Obj(); …. register_block_type( ‘my-plugin/my-block’, [ ‘editor_script’ => ‘editor-script-handle’, ‘render_callback’ => [ $obj, ‘block_save_function’ ] ] ); In that code [ $obj, ‘block_save_function’ ] is equivalent to $obj->block_save_function(…. The important thing to note, is that render_callback‘s value is a PHP callable type. You need … Read more