Title: Plugin Error (already declared)
Last modified: August 31, 2016

---

# Plugin Error (already declared)

 *  Resolved [ipwob](https://wordpress.org/support/users/ipwob/)
 * (@ipwob)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/plugin-error-already-declared/)
 * Hi there
 * Can someone explain me, why the following test code already generates an error(…
   previously declared…)?
 *     ```
       if ( ! function_exists( 'mod_footer_admin' ) ) {
         function mod_footer_admin() {
           echo 'My static footer text goes here';
         }
       }
       add_filter('admin_footer_text', 'mod_footer_admin');
       ```
   
 * I am new to plugin development and in order to avoid issues with other plugins
   I created a simple test, which already throws that error at me that I tried to
   test/avoid:
    1.  1. In my themes function.php I am calling that function to modify the footer
       
       2. In my plugin I created exactly that function again to see if the function
       from the plugin will be ignored (as expected as themes function.php seems to
       have the higher priority)
 * Unfortunately I am receiving the error:
    `Fatal error: Cannot redeclare remove_footer_admin()(
   previously declared in .../mypluginname_plugin.php:26) in /srv/www/.../functions.
   php on line 26`
 * I expected that `if ( ! function_exists...` will add a function unless its already
   defined and though if it is defined it won`t break the page = ignored?

Viewing 1 replies (of 1 total)

 *  Thread Starter [ipwob](https://wordpress.org/support/users/ipwob/)
 * (@ipwob)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/plugin-error-already-declared/#post-7421809)
 * grmpf… after switching on my brain again I realized its the function from within
   the functions.php throwing the error. As perfectly stated in the related error
   message.

Viewing 1 replies (of 1 total)

The topic ‘Plugin Error (already declared)’ is closed to new replies.

## Tags

 * [add_filter](https://wordpress.org/support/topic-tag/add_filter/)
 * [function_exists](https://wordpress.org/support/topic-tag/function_exists/)

 * 1 reply
 * 1 participant
 * Last reply from: [ipwob](https://wordpress.org/support/users/ipwob/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/plugin-error-already-declared/#post-7421809)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
