How do I load bloginfo URL in PHP function?

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.

Read More

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?

Related posts

Leave a Reply

1 comment