get_field for a widget value returns null ACF

We can’t get the whole picture unless we see exactly where your code has been added and called, but I suggest to check every variables value of this line of code $is_mobile_enabled = get_field('mobile_enable', 'widget_' . $args['widget_id']);

  • Check the value of $args['widget_id'], as if it may be empty.
  • Also, it’s better to use error_logs instead of var_dump, you can do it something like this error_log(print_r($is_mobile_enabled,true));

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)