简体   繁体   English

自定义BuddyPress注册表单模板,而不仅仅是registar.php

[英]Customizing BuddyPress registration form template, not just registar.php

I know that general modifications can be made to register.php, but it still does not provide direct access to the inputs or labels in any meaningful way. 我知道可以对register.php进行一般性的修改,但是仍然不能以任何有意义的方式直接访问输入或标签。 I want to add additional blocks to better organize groups of fields. 我想添加其他块以更好地组织字段组。 Currently using BP 3.2.0 当前使用BP 3.2.0

Basically BP allows modification to the elements surrounding it. 基本上,BP允许对其周围的元素进行修改。

For example ( https://github.com/buddypress/BuddyPress/blob/master/src/bp-templates/bp-nouveau/buddypress/members/register.php ): 例如( https://github.com/buddypress/BuddyPress/blob/master/src/bp-templates/bp-nouveau/buddypress/members/register.php ):

        <div class="register-section default-profile" id="basic-details-section">

            <?php /***** Basic Account Details ******/ ?>

            <h2 class="bp-heading"><?php esc_html_e( 'Account Details', 'buddypress' ); ?></h2>

            <?php bp_nouveau_signup_form(); ?>

        </div><!-- #basic-details-section -->

bp_nouveau_signup_form(); bp_nouveau_signup_form(); Gets called in template-tags.php: https://github.com/buddypress/BuddyPress/blob/master/src/bp-templates/bp-nouveau/includes/template-tags.php However, this file is a direct part of the plugin and can't be overwritten in the same manner as register.php 在template-tags.php中被调用: https : //github.com/buddypress/BuddyPress/blob/master/src/bp-templates/bp-nouveau/includes/template-tags.php但是,此文件是直接部分插件,不能以与register.php相同的方式覆盖

There doesn't appear to be a transparent and clean way modifying the form structure. 似乎没有透明,干净的方式修改表单结构。

It seems like you will have to modify that in the bp_nouveau_signup_form(); 看来您必须在bp_nouveau_signup_form();中进行修改。 function. 功能。 If you are using phpstorm, you can double tap shift and search all the project files for it. 如果您使用的是phpstorm,则可以双击shift并搜索所有项目文件。

it starts on line 2299 of the file you linked 它从您链接的文件的2299行开始

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM