dongxiong2000 2014-01-12 13:00
浏览 36

修改注册URL

This code displays a 'Register' link; I want to redirect this link to "www.myDomain.com/register/" how can I change this?

<?php
  if ( get_option( 'users_can_register' ) ) :
  $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );``/*** Filter the registration URL below the login form.
  ** @since 1.5.2** @param string $registration_url Registration URL.
  */echo ' | ' . apply_filters( 'register', $registration_url );endif;?></p>
  • 写回答

3条回答 默认 最新

  • dougu5886 2014-01-12 13:05
    关注

    Use the register_url filter to modify the URL returned by wp_registration_url.

    Sample code (put it in your plugin or theme/functions.php file):

    add_filter( 'register_url', 'custom_register_url' );
    function custom_register_url( $register_url )
    {
        $register_url = "YOUR_PAGE_URL";
        return $register_url;
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于无人驾驶的航向角
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退