[resolved] Plugin: Adding Top-level menu inside folder errors (2 posts)

  1. mikexstudios
    Posted 10 years ago #


    I was experimenting around with adding administration menus via plugins and found this strange error. I took the sample 'Menu Test' plugin on this page:
    and placed it in two locations:
    1. in wp-content/plugins/
    2. in wp-content/plugins/menutest/

    In #1, clicking 'Test Toplevel' works perfectly.
    In #2, clicking 'Test Toplevel' gives the following error:

    Fatal error: Cannot redeclare mt_add_pages() (previously declared in C:\Development\wordpress\wp-content\plugins\menutest\menutest.php:13) in C:\Development\wordpress\wp-content\plugins\menutest\menutest.php on line 11

    Somehow a function redeclaration check isn't being applied when the base plugin file is placed in a subdirectory of plugins/. This seems to only be a problem when the plugin uses add_menu_page (since Spam Karma 2 is housed in a subdirectory and has no problems with the menus).

    Anyone have any ideas?

    [edit]I'm using version 1.5.2[/edit]

  2. mikexstudios
    Posted 10 years ago #

    Nevermind. I decided to take matters in my own hands and track down the bug and write a solution.

    Ticket and solution here:

Topic Closed

This topic has been closed to new replies.

About this Topic