So I'm using WordPress for this project, and I'm not quite sure how to go about this neat & clean.
I've got 8 options total. If ANY of them are set, I need something to happen. I also need to execute it for each one set.
Let's use two, for now
if( (genesis_get_option('setting_one', 'settings') || genesis_get_option('setting_two', 'settings')) !== '')
{ // print() each one that is set }
You can see how doing it that way for 8 options would get very ugly very quickly. All of my settings all have an identical prefix: (setting_a
, setting_b
, setting_one
,setting_two
)
I was thinking something like
$settings = array_fill(1, 8, 'setting_');
$labels = array(1 => 'a', 'b', 'c', 'd', 'one', 'two', 'three', 'four');
.... but then I don't know where to go from there.
There's GOT to be some sort of clean way to do this?