Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Using The Options
<?php echo $options['unique_id']; ?>
where unique_id is the id set for the field when creating the section fields.
Or you can use the Frameworks solution
The Framework comes with some functions which can be used to get the options, with you needing to remember the option name.
Just make sure when calling the class you assign it to a global var like so:
<?php global $NHP_Options; $NHP_Options = new NHP_Options($sections, $args); ?>
Then you can use the two built in functions for options display
Using get, will "get" the option value from the main options array, so if you have a field with the id of "10", to get that option just call:
<?php global $NHP_Options; $option_val = $NHP_Options->get('10'); ?>
To echo the option you can call the
<?php global $NHP_Options; $NHP_Options->show('10'); ?>
Note Using the show function on an array value (like multi select/checkbox values) will result in nothing being echoed.
Also if you would like to get the whole options array, just call the classes options var like so:
global $NHP_Options; $options_array = $NHP_Options->options;
Note you only need to declare the global command once per script, ideally at the top of the file, then you would just call the functions wherever you need them.