Monday, 31 August 2020

Add data into wpdb Column when user login

//how to update current user role in custom user column inside wpdb.
//update must effect only the current user

global $wpdb;
$user_Tag = $current_user->ID; //ID hook
$push_status = 'customer'; // custom string

if(current_user_can('customer') ) {$wpdb->update( 'wpdb_table_name', array( 'wpdb_role_column' =>$push_status), array( 'wpdb_id_column' => $user_Tag ), array( '%s' ));
}

Translate manually Wordpress

 add_filter( 'gettext', function( $translated, $original, $domain ) {     // Senarai penggantian (case-insensitive)     $map = array...