From f962cc2436aceb06b3ac1e56ae2073de9f5533bf Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 16 Aug 2009 12:29:25 -0400 Subject: [PATCH] make update method call handling more dynamic --- classes/WhatDidTheySayAdmin.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/WhatDidTheySayAdmin.php b/classes/WhatDidTheySayAdmin.php index 66c8c50..3933316 100644 --- a/classes/WhatDidTheySayAdmin.php +++ b/classes/WhatDidTheySayAdmin.php @@ -90,11 +90,11 @@ class WhatDidTheySayAdmin { } function handle_update($info) { - foreach (array( - 'languages', 'capabilities' - ) as $method) { - $result = $this->{"handle_update_${method}"}($info); - if (!empty($result)) { $this->notices[] = $result; } + foreach (get_class_methods($this) as $method) { + if (strpos($method, "handle_update_") === 0) { + $result = $this->{$method}($info); + if (!empty($result)) { $this->notices[] = $result; } + } } }