[wp-hackers] Strange plugin fatal error

Jeremy Visser jeremy.visser at gmail.com
Wed Apr 9 13:36:45 GMT 2008


On Mon, 2008-04-07 at 15:12 +0530, Sudar Muthu wrote:
> When you try to use if (!function_exists) { ....} the error message will be
> simply shown in the next function which is not wrapped with the
> function_exists condition.

My apologies. I just re-read what I wrote, and I see how you
misinterpreted me.

I meant to wrap _each_ function in its own function_exists() like this:

        if (!function_exists('similar_posts')) :
        function similar_posts() {
          // blah blah
        }
        endif;

        if (!function_exists('lolcats')) :
        function lolcats() {
          // can i has cheezburger?
        }
        endif;

        if (!function_exists('secret_google_search_algorithm')) :
        function secret_google_search_algorithm($url) {
          $pagerank = 2;
          if (strpos($url, 'jeremy.visser.name') !== false)
            $pagerank = 10;
          return $pagerank;
        }
        endif;

-- 
Jeremy Visser                                 http://jeremy.visser.name/

()                           ascii ribbon campaign — against HTML e-mail
/\                                               http://asciiribbon.org/



More information about the wp-hackers mailing list