Skip to content
Browse files

Use menu_page_url instead of admin_url

For the toolbar link. This way, we don't have to hardcode the location and WordPress can figure it out on-the-fly.
  • Loading branch information...
1 parent aaf2c36 commit a09762e86e3de9cc45c40bf59554f0062119ff83 @mjangda mjangda committed Aug 7, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 developer.php
2 developer.php
@@ -177,7 +177,7 @@ public function add_node_to_admin_bar( $wp_admin_bar ) {
'id' => self::PAGE_SLUG,
'title' => esc_html__( 'Developer', 'a8c-developer' ),
'parent' => 'top-secondary', // Off on the right side
- 'href' => admin_url( 'tools.php?page=' . self::PAGE_SLUG ),
+ 'href' => menu_page_url( self::PAGE_SLUG, false ),
'meta' => array(
'title' => esc_html__( 'View the Developer Helper settings and status page', 'a8c-developer' ),

5 comments on commit a09762e


On front-end
Fatal error: Call to undefined function menu_page_url() in xxxxxxxxxxxxx\developer\developer.php on line 180

Automattic member

Lame; reverted.

Automattic member

We could include the file where it's defined on the front-end. Should (probably) work fine.

Automattic member

The admin menu structure won't be available either, which is probably why that function isn't. I think hard-coding is good enough.

Automattic member

Ah right.

Please sign in to comment.
Something went wrong with that request. Please try again.