Consider this code:
$admin_bar->add_menu( array(
'id' => 'options_page',
'parent' => 'customize_page',
'title' => 'Options Page',
'href' => admin_url( 'customize.php?url=/my_page/'),
'meta' => array(
'title' => __('Options Page'),
'target' => '_self',
'class' => 'my_menu_item_class'
),
I need to get the value of WP’s URL so that I can load this code in the admin area.
I usually use bloginfo(‘url’), but I searched everywhere and couldn’t find the proper way to make it work, only by adding the absolute URL, which I don’t want to.
Any idea on what’s the correct code to make this work?
Change the line
to this: