Support » Plugins and Hacks » Including plugin template tag inside functions.php

  • Ok, I have plugin that generates a template tag which outputs <a href="">link <span>1</span></a> and I want to include it in the admin bar through the functions.php file. Here’s what I’m trying to do, but it’s not working.

    function wp_admin_custom_link() {
    global $wp_admin_bar, $wpdb;
    if ( !is_super_admin() || !is_admin_bar_showing() )
    return;
    $link_var = '<?php echo template_tag() ?>';
    /* Add the main siteadmin menu item */
    
    $wp_admin_bar->add_menu( array( 'id' => 'link var', 'title' => $link_var, 'href' => FALSE ) );
    
    }
    add_action( 'admin_bar_menu', 'wp_admin_custom_link', 1000 );

    Not sure if there’s another way to pass that that template tag to functions.php file, would really appreciate help.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Including plugin template tag inside functions.php’ is closed to new replies.