How to pass variable to add_settings_section() callback?

I am attempting to automate, as much as possible, the Settings API function calls for each setting in a Plugin. Looping through the options array, and outputting add_settings_section() and add_settings_field() is simple enough: add_settings_section(): $oenology_hooks_tabs = oenology_hooks_get_settings_page_tabs(); foreach ( $oenology_hooks_tabs as $tab ) { $tabname = $tab[‘name’]; $tabtitle = $tab[‘title’]; $tabsections = $tab[‘sections’]; foreach ( … Read more

How to pass arguments from add_settings_field() to the callback function?

I have a function like this: add_settings_field( ‘contact_phone’, ‘Contact Phone’, ‘settings_callback’, ‘general’); That works. It calls settings_callback. Cool. The problem I have with this is: I don’t want to have to define a callback function for every setting I add, if all I’m doing is echoing out a little bit of stuff. function settings_callback() { … Read more

“Error: Options Page Not Found” on Settings Page Submission for an OOP Plugin

I am developing a plugin using Tom McFarlin’s Boilerplate repository as a template, which utilizes OOP practices. I’ve been trying to figure out exactly why I’m unable to correctly submit my settings. I’ve tried setting the action attribute to an empty string as suggested on another question around here, but that hasn’t helped… Below is … Read more