The below is a dependency of another script, and in its current form it works just fine. It's just some info needed to authenticate an API call.
<?php
class getStuff {
public $subdomain = 'somedomain';
public $key = '123-456-789';
}
?>
However, the values are static. I want to use get_option() to make these values easily changeable from wp-admin. So I figured that this would make sense...
<?php
class getStuff {
public $subdomain = get_option( 'option_subdomain' );
public $key = get_option( 'option_key' );
}
?>
Of course, it won't work. I've read and tried a lot of examples on constructors they seem to be addressing different problems. I'm not exactly sure what to look for...
BTW, there is nothing wrong with the way information is stored in options.php - it's working just fine.