English 中文(简体)
把我的活动链接添加到Buddypress 管理员酒吧吗?
原标题:Add my-events link to buddypress admin bar?
  • 时间:2012-05-23 21:20:55
  •  标签:
  • buddypress

在巴迪普雷斯的网站上,我正在工作,有人要求我加入一个直接链接到行政栏上的“我的活动”,因为这将是这个网站的管理员们最经常使用的特点。 获取链接到这个页面的正确方式是什么? 我认为我正在寻找类似的东西, 但是它没有起作用:

 get_permalink( get_page_by_path(  events/my-events  ) );
最佳回答

A direct link to my-events for who ? The admin? The displayed user ?

This should add an admin link for the displayed user - or at least get you started. Put it in plugins/bp-custom.php

function add_my_events_link() { 
    global $bp;
    if ( !is_super_admin() || bp_is_my_profile() || !$bp->displayed_user->id )
        return false;
?>
    <li><a href="<?php echo wp_nonce_url( $bp->displayed_user->domain .  events/my-events/ ,  my-events  ) ?>" class="confirm"><?php printf( __( "My Events for ",  buddypress  ), esc_attr( $bp->displayed_user->fullname ) ) ?></a></li>
<?php
}
add_action(  bp_adminbar_menus ,  add_my_events_link , 20 );
问题回答

暂无回答




相关问题
is buddypress out of wordpress family?

they removed buddypress category from their showcase, lead developer Andy Peatling is not there, and there are some sad articles on buddypress but nothing specific. Do you know what the status is?

BuddyPress slug prefix

At the official BuddyPress website http://buddypress.org/ They are running a single WordPress installation with BP. However for some of the pages they have prefixed them with /community/ for example: ...

Wordpress and buddypress advice

I have a website that I want to setup so that users can register for the site but the administrator of the site will have the final say on whether or not they can be a member of the site or not. I am ...

Profile url error in Buddypress

I have installed buddypress on localhost. It is working fine. The problem is when currently logged in user view other user s profile page then it displays wrong url. It is currently displaying ...

Fatal error: Cannot redeclare happening on same line

I have been fighting with this error for a while. The error is somewhere in the function I now have php telling me it can t redeclare a variable on the same line... strange. Any help would be great. ...

Geolocation with wordpressmu/buddypress

I am just looking for the best solution for the following problem. I have installed wordpress mu, and I wanted to create child blogs, for different areas in the world. But I want it so 1 domain can ...

热门标签