• Resolved Niklas

    (@niklasbr)


    As far as I understand the documentation, this should move the WP-Table Reloaded menu to the upload.php (Media) section of the admin menu, but instead it moves WP-Table Reloaded to the Tools menu.

    add_filter('wp_table_reloaded_admin_menu_parent_page', 'nbr_move_wp_table_reloaded');
    function nbr_move_wp_table_reloaded($admin_menu_page) {
        return "upload.php";
    }

    As a side note I wonder if it is possible to make it a top menu item (my users request it)?

    http://wordpress.org/extend/plugins/wp-table-reloaded/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    yes, in theory it would work like that.
    The problem here is, that “upload.php” is not in the “white list” (see $possible_admin_menu_parent_pages in line 87 of controller-base.php), for some reason… And if the value is not that in that list, it gets defaulted to “tools.php”.

    Now, as you actually seem to want the entry as a top menu item anyway, here’s how to do that: Either use “admin.php” as the return value, or (which might be simpler) just select “Top-level” in the “Admin Menu entry” dropdown list on the “Plugin Options” screen. Using that is much simpler than using a filter hook 🙂

    Best wishes,
    Tobias

    Thread Starter Niklas

    (@niklasbr)

    Using top level with return “admin.php”; does nothing, it just keeps it below the separator under options-general.php.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    and isn’t that a top-level menu entry then? In my understanding it is… Or where were you expecting the menu entry, and where do you want it?

    Regards,
    Tobias

    Thread Starter Niklas

    (@niklasbr)

    HIgher up towards the top, like above upload.php.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    ah ok, I see. Sorry that I have to disappoint you, but with the current implementation of the menu integration, this is not possible for WP-Table Reloaded at this time. 🙁

    Best wishes,
    Tobias

    Thread Starter Niklas

    (@niklasbr)

    How high can I move it?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    as I said, this is not possible with WP-Table Reloaded. You would have to manually manipulate the global $menu array, which is the variable where WordPress stores the admin menu setup.

    Regards,
    Tobias

    Thread Starter Niklas

    (@niklasbr)

    Can I put in a feature request or pledge a donation for this feature?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    I’ll add this to my feature ideas list, and donations are always welcome to further support the development and support of the plugin, but I can’t promise anything right now.

    Now, after checking the WordPress core code again, I think there might be a possibility for you. It is a little bit ugly, as it (currently) requires that you slightly modify a file in WP-Table Reloaded (because there’s no filter hook for this), but I guess that you can live with that. You would just have to repeat this modification after WP-Table Reloaded is updated. The necessary change:
    In the file “controllers/controller-admin.php”, change line 213 to

    $this->hook = add_menu_page( 'WP-Table Reloaded', $display_name, $min_capability, $this->page_slug, array( &$this, 'show_manage_page' ), plugins_url( 'admin/plugin-icon-small.png', WP_TABLE_RELOADED__FILE__ ), 9 );

    (Note the additional parameter 9 at the end of the line. The “Media” menu item is position 10, so the value 9 should move WP-Table Reloaded before the “Media” item.)
    Also, for this to work, your filter above needs to return “admin.php” (or just select “Top-level” in the “Plugin Options”, as you won’t need the filter then).

    Regards,
    Tobias

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi again,

    a different solution might be to use the “Admin Menu Editor” plugin from http://wordpress.org/extend/plugins/admin-menu-editor/ , which seems to allow you to move the menu items.
    I didn’t test this though.

    Regards,
    Tobias

    Thread Starter Niklas

    (@niklasbr)

    Thanks!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    sure, no problem! You are very welcome!

    Best wishes,
    Tobias

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: WP-Table Reloaded] wp_table_reloaded_admin_menu_parent_page woes’ is closed to new replies.