Zenphoto 1.2.3 and Wordpress -> function-error?

I am running ZP 1.2.2 within a WP 2.6.5 installation without any problems.

When I try to use ZP 1.2.3 with my customized theme I get the error:
Fatal error: Cannot redeclare has_filter() (previously declared in .../zp-core/functions-filter.php:185) in .../wp-includes/plugin.php on line 99
(note: ... is my installation path)

With my humble coding knowledge I can only guess that Wordpress uses the same function declaration. There are some lines in the plugin.php file.
Is anybody out there who can give me a helping hand to get rid of this error? I even don't know what this function is about :(
Thanks,
stef

Comments

  • I'm getting this too.
    I see that both WP and ZP have a function 'has_filter' also 'remove_filter'
    I changed to zp functions to 'has_zpfilter' and remove_zpfilter'

    SEEMS to be working, but hopefully a developer who knows what they're doing (I really don't) can weigh in.

    Even if this doesn't break anything, it will be a pain for coming upgrades - so BEWARE before following my lead!!!
    a
  • acrylian Administrator, Developer
    We might rename them later. Of course we cannot check every system (mostly it's Wordpress but not exclusively) that maybe is used with Zenphoto if it has similar named functions.

    Your renaming might break something if those functions are called somewhere.
  • Thanks for your reply.
    Is there an easy way to replace all strings has_filter() and remove_filter()?
  • stef404..
    It's really simple, just open the files named in your error, scroll down to the line numbers mentioned and change the name. -you can also search and replace.
    - at the end of the end of the day, I did abandon this method (calling the wp header) due to the 404 issues mentioned in other forum topics. Disappointing, because otherwise, it worked beautifully.

    acrylian... again, I'm no coder, but I wander if it would make sense to name all functions (at least the names that might be common)zp....
  • It looks like those functions are not used anywhere yet, so renaming them should not cause problems. The others--`register_filter` and `apply_filter` are used, so hope they are not causing problems.

    We will rename the two to `zp_has_filter()` and `zp_remove_filter()`
  • @sbillard: Great news.
    I'm impressed by the fast response and helpful hints of the ZP development team.
    Thank you very much. Great job!
Sign In or Register to comment.