make update method call handling more dynamic
This commit is contained in:
parent
af689daebe
commit
f962cc2436
@ -90,13 +90,13 @@ class WhatDidTheySayAdmin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handle_update($info) {
|
function handle_update($info) {
|
||||||
foreach (array(
|
foreach (get_class_methods($this) as $method) {
|
||||||
'languages', 'capabilities'
|
if (strpos($method, "handle_update_") === 0) {
|
||||||
) as $method) {
|
$result = $this->{$method}($info);
|
||||||
$result = $this->{"handle_update_${method}"}($info);
|
|
||||||
if (!empty($result)) { $this->notices[] = $result; }
|
if (!empty($result)) { $this->notices[] = $result; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function handle_update_languages($language_info) {
|
function handle_update_languages($language_info) {
|
||||||
$options = get_option('what-did-they-say-options');
|
$options = get_option('what-did-they-say-options');
|
||||||
|
Loading…
Reference in New Issue
Block a user