WordPress.org

Ready to get started?Download WordPress

Forums

Including plugin template tag inside functions.php (3 posts)

  1. Viktor Nagornyy
    Member
    Posted 2 years ago #

    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.

  2. Viktor Nagornyy
    Member
    Posted 2 years ago #

    Would love some help on this, stuck. Tried everything, even pulling $var that the plugin uses to pass that info to the template tag by including that file in functions file. Nothing.

    I hate being stuck.

  3. Viktor Nagornyy
    Member
    Posted 2 years ago #

    I guess this is harder to do than I thought.

Topic Closed

This topic has been closed to new replies.

About this Topic