2 WordPress sites with 2 databases but sharing the same users

It’s not possible in WordPress to have shared users between 2 separates installations on 2 separated databases. It could be possible just by hardcoding: hardcode WP_User class connect to other database and retrieve users from there hardcode get_metadata() function, that for wp_usermeta table connect to other database and retrieve users from there but mentioned solution … Read more

db converts decimal number wrong

Within $wpdb->insert, you are using %d which is used to store integer, use %f instead which will store float/decimal values. $registrering = $wpdb->insert( $wpdb->prefix . ‘registreringer’, array( ‘fiske_vaegt’ => $fiske_vaegt ), array( ‘%f’ ) );