I have a theme that I'm developing from an HTML template I have. I'm also designing an options page along with a plethora of plugins built-into the theme itself. I've chosen a tabbed interface and I'm trying to learn how to use WordPress' Settings API.
I'm using a class structure for the theme's functions. The following is the declaration of registering settings and whatnot.
public function __admin_init()
{
register_setting( 'cncfps_twitter', 'cncfps_twitter_options', array( &$this, 'wp_cncfps_twitter' ) );
add_settings_section( 'cncfps_twitter', 'Twitter', array( &$this, 'wp_cncfps_twitter' ), 'cncfps' );
add_settings_field( 'cncfps_twitter_consumer_key', 'Consumer Key', array( &$this, 'twitter_consumer_key' ), 'cncfps', 'cncfps_twitter' );
add_settings_field( 'cncfps_twitter_consumer_secret', 'Consumer Secret', array( &$this, 'twitter_consumer_secret' ), 'cncfps', 'cncfps_twitter' );
add_settings_field( 'cncfps_twitter_apikey', 'API Key', array( &$this, 'twitter_apikey' ), 'cncfps', 'cncfps_twitter' );
}
public function wp_cncfps_twitter()
{
// TODO: wut. ?!?!
echo "what is this?";
}
public function twitter_consumer_key()
{
echo "Hello";
}
public function twitter_consumer_secret()
{
echo "World";
}
When I want to display the fields as shown here, I don't see a thing. The following is how I attempt to display them. I did follow a few tutorials but it's just not clicking in my brain for some reason.
settings_fields('cncfps_twitter');
do_settings_sections('cncfps_twitter');