您现在的位置是:首页 > 网站制作 > WordpressWordpress

WordPress函数wp_register()

杰帅2023-08-13【Wordpress】人已围观

简介描述

描述

如果用户已登录,此标记将显示“站点管理”链接,如果用户未登录,则显示“注册”链接。

如果未选中管理 > 设置 > 常规 > 成员资格:任何人都可以注册框,则不提供“注册”链接。

用法

<?php wp_register( $before, $after, $echo ); ?>

参数

$before
(string) (optional) Text to display before the Register or Site Admin link.
Default: ' '
$after
(string) (optional) Text to display after the Register or Site Admin link.
Default: '

'
$echo
(boolean) (optional) If true, echos the link, if false, returns the link as a string
Default: true

示例

默认
wp_register以列表格式 显示链接。

<?php wp_register(); ?>

在连接前后不显示任何内容

The following code example displays the "Register" or "Site Admin" link with no text in before or after parameters.

<?php wp_register('', ''); ?>

当未登录的情况下,显示输出为:

<a href="http://www.example.com/wp-login.php?action=register">Register</a>

当在登录状态后,显示输出为:

<a href="http://www.example.com/wp-admin/">Site Admin</a>

Tags:wordpress函数   注册   登录   链接

很赞哦! ()

文章评论

本站推荐

站点信息

  • 建站时间:2018-10-24
  • 网站程序:帝国CMS7.5
  • 主题模板《今夕何夕》
  • 文章统计1172篇文章
  • 标签管理标签云
  • 统计数据百度统计
  • 微信公众号:扫描二维码,关注我们