I am using `ACF` plugin to add a custom field to my widgets. After creating the field with the name `mobile_enable`, tried to get the value with the method explained in the ACF docs which is the following:
the_field('field_name', 'widget_' . $widget_id)
Inside the widget method we can get the widget_id
like this:
public function widget( $args, $instance ) {
$widget_id = $args['widget_id']
}
The problem I am having is that the following code returns null even after enabling the option with the checkbox:
$is_mobile_enabled = get_field('mobile_enable', 'widget_' . $args['widget_id']);
var_dump($is_mobile_enabled);
'mobile_enable'
are you missing a "d"?