/**
  * Adds the user archive link to `$items` array.
  *
  * @since  1.0.0
  * @access public
  * @return void
  */
 public function mb_do_user_archive_link()
 {
     $this->items[] = sprintf('<a href="%s">%s</a>', mb_get_user_archive_url(), mb_get_user_archive_title());
 }
예제 #2
0
/**
 * Returns the URL (/board/users/roles/rolename) for a specific role.  Note that we remove the `mb_` prefix
 * for prettier URLs.  Only forum-specific roles get archive pages.
 *
 * @since  1.0.0
 * @access public
 * @param  string  $role
 * @return string
 */
function mb_get_role_url($role = '')
{
    global $wp_rewrite;
    $role = mb_get_role($role);
    $dynamic_roles = mb_get_dynamic_roles();
    $url = '';
    if (isset($dynamic_roles[$role])) {
        if ($wp_rewrite->using_permalinks()) {
            $url = user_trailingslashit(trailingslashit(mb_get_role_archive_url()) . str_replace('mb_', '', $role));
        } else {
            $url = add_query_arg('mb_role', $role, mb_get_user_archive_url());
        }
    }
    return apply_filters('mb_get_user_archive_url', $url);
}
예제 #3
0
/**
 * Returns the user archive link.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function mb_get_user_archive_link()
{
    $link = sprintf('<a class="mb-user-archive-link" href="%s">%s</a>', mb_get_user_archive_url(), __('Users', 'message-board'));
    return apply_filters('mb_get_user_archive_link', $link);
}
예제 #4
0
function mb_get_role_archive_url()
{
    global $wp_rewrite;
    if ($wp_rewrite->using_permalinks()) {
        $url = user_trailingslashit(trailingslashit(mb_get_user_archive_url()) . 'roles');
    } else {
        $url = add_query_arg('mb_custom', 'roles', home_url());
    }
    return apply_filters('mb_get_role_archive_url', $url);
}