WordPress.org

Ready to get started?Download WordPress

Forums

$page_hook - issue (2 posts)

  1. mihaigrigori
    Member
    Posted 8 years ago #

    I installed wp-cache plugin on a WP install v1.5. This plugin integrates itself into wp-admin in option under WP-cache section. I does that using
    add_action('admin_menu', 'wp_cache_add_pages');
    Anyway the proble was that I already had a plugin that was integrated too in the same manner and stopped working after I activated wp-cache.
    Why? (it took me some time but found it)
    A global variable called $page_hook was being overridden in the file menu-header.php arround the line 42 (where the submenu is created). So no matter what section I was selecting only the last one was being dispalyed.
    Solution.
    I changed the name of that variable $page_hook into $local_page_hook in the file menu-header.php


    if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}")) {
    $local_page_hook = get_plugin_page_hook($item[2], $parent_file);
    if ( $local_page_hook )
    ....

    (I don't think this will affect other stuff as long as it is used only to create that submenu)

    Maybe this is a bug. Maybe not. Maybe this will help someone.

  2. moshu
    Member
    Posted 8 years ago #

    WP install v1.5...
    It seems you hit a similar problem as this poster:
    http://wordpress.org/support/topic/48750
    Maybe upgrading to 1.5.2 would be a good idea.

Topic Closed

This topic has been closed to new replies.

About this Topic