I am trying to add_settings_section() by supplying a callback with parameter as follows:
class warpress_progression_plugin {
function warpress_progression_plugin() {
$this->__construct();
}
function __construct() {
add_action('admin_init', array(&$this, 'plugin_admin_init'));
}
function plugin_admin_init() {
$rows = $this->get_options_structure();
for ($i = 0; $i < count($rows); $i++) {
add_settings_section('expansion_'.$row->expansion_id,'',call_user_func(array(&$this, 'display_expansion'), $row->expansion),'warpress_progression'); // PROBLEM SEEMS TO BE HERE
}
}
function display_expansion($expansion_name) {
echo "<h3>" . $expansion_name . "</h3>";
}
}
However, I'm getting the following error:
Warning: call_user_func() [function.call-user-func]: First argument is expected to be a valid callback
However, the echo of
"<h3>" . $expansion_name . "</h3>"
is occurring as I would have expected. What am I doing wrong here?