You inserting the value of the get_option('go_to_top_or_bottom');
as a property in the $this->options
so when you actual try to print it like this print_r($this->options['turn_on']);
you get the index error because this is a property!!!
Correct way will be $this->options['turn_on']=get_option('go_to_top_or_bottom');
Update
I see that the $options
is a private meaning you cannot access it outside of the class.
A solution will change the type to public
Or introduce another property as public
.
If you don’t want to change the Class
you can create a variable to use it in the view file like this :
$options=get_option('go_to_top_or_bottom');
And access them with $options["'turn_on'"];
Mind the single quotes ( This is due to the serialization with the quoted names).