WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using wp customizer in a theme and I want to load a page using a link in admin bar. Link in admin bar is added, and link format is like this: http://www.domain.com/dashboard/customize.php?url=/page_to_edit

However, it still loads the homepage in the customizer iframe, so guess I'm doing something wrong. For reference, This is the code I'm using (the part that matters):

$admin_bar->add_menu( array(
        'id'    => 'my_page',
        'parent' => 'customize_page',
        'title' => 'My Page',
        'href' => admin_url( 'customize.php?url=/my_page/'),
        'meta'  => array(
            'title' => __('My Page'),
            'target' => '_self',
            'class' => 'my_menu_item_class'

Now, if I load the full absolute URL it works fine, but no idea how to make bloginfo load inside this array. I found in another post that I can use get_bloginfo (not sure if that's correct) but also no idea how to make it work after the admin_url part.

Any help really appreciated, this is driving me crazy!

share|improve this question
did you tried - admin_url( 'customize.php?url='. site_url('/my_page/') ) ? – Shazzad Feb 11 '14 at 1:31
Shazzad, this is absolutely perfect, you should have added it as an answer so I could have accepted it. If you do it, I'll accept it anyway, many thanx! :) – Devin Feb 11 '14 at 1:35
up vote 2 down vote accepted

Absolute url can be retrieved with site_url() function. It's similar to admin_url() function, except site_url() is used for front end url's, while admin_url() is for backend url's. So you could try

admin_url( 'customize.php?url='. site_url('/my_page/') )
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.