您如何在Buddypress次要个人资料部分显示和编辑一组字段?

时间:2019-04-30 11:38:36

标签: wordpress nav profile buddypress items

电子邮件:jef18+99@live.ca 密码:zV00CjHsfWtG

https://businessclubafrica.com/our_members/infojeffm-ca/myorganization/edit/

嗨, 我设法将自定义标签添加到bp导航菜单。不幸的是,我无法超越这一步。首先,我们需要将两个组集成在同一个人资料页面上,并使用一个按钮https://buddypress.org/support/topic/sending-multiple-xprofile-forms/发送两个组,还需要显示并能够编辑我们网站的“我的组织”部分,包含xprofile组ID#5。

这是bp-custom.php中我的代码的一部分,其中包含那些生成选项卡并回显相应部分中的字段的调用:

[请参阅该线程附带的代码]

因此,这是我的问题,如果无法解决,则无需全部回答。

1-如何管理显示和编辑#5组?实际上,在我的组织页面上工作的唯一字段组是#1。 2-如何防止提交者重定向到“我的资料”标签页并停留在“我的组织”上? 3-请看看我在该线程中插入的其他线程。

谢谢!!

我已经在我的个人资料页面上进行了测试,并且可以正常工作,我已经回显了值,但没有回显任何内容。

function myorganization_screen() {
    add_action( 'bp_template_title', 'myorganization_screen_title' );
    add_action( 'bp_template_content', 'myorganization_screen_content' );
    bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}
function myorganization_screen_title() {
    echo 'My Organization<br/>';
}
function myorganization_screen_content() {
    echo 'My Organization informations<br/>';
}


function edit_screen() {
    add_action( 'bp_template_content', 'edit_screen_content' );
    bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}
function edit_screen_content() {
/**
 * BuddyPress - Members Single Profile Edit
 *
 * @package BuddyPress
 * @subpackage bp-legacy
 * @version 3.0.0
 */

/**
 * Fires after the display of member profile edit content.
 *
 * @since 1.1.0
 */
do_action( 'bp_before_profile_edit_content' );

if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) :
    while ( bp_profile_groups() ) : bp_the_profile_group(); ?>

        <form action="<?php bp_the_profile_group_edit_form_action(); ?>" method="post" id="profile-edit-form" class="standard-form <?php bp_the_profile_group_slug(); ?>">

            <?php

            /** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
            do_action( 'bp_before_profile_field_content' ); ?>

            <h2><?php printf( __( "Editing '%s' Profile Group", 'buddypress' ), bp_get_the_profile_group_name() ); ?></h2>

            <?php if ( bp_profile_has_multiple_groups() ) : ?>
                <ul class="button-nav" aria-label="<?php esc_attr_e( 'Profile field groups', 'buddypress' ); ?>" role="navigation">

                    <?php bp_profile_group_tabs(); ?>

                </ul>
            <?php endif ;?>

            <div class="clear"></div>

            <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>

                <div<?php bp_field_css_class( 'editfield' ); ?>>
                    <fieldset>

                        <?php
                        $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
                        $field_type->edit_field_html();

                        /**
                         * Fires before the display of visibility options for the field.
                         *
                         * @since 1.7.0
                         */
                        do_action( 'bp_custom_profile_edit_fields_pre_visibility' );
                        ?>

                        <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
                            <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"><span id="<?php bp_the_profile_field_input_name(); ?>-2">
                        <?php
                        printf(
                            __( 'This field can be seen by: %s', 'buddypress' ),
                            '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>'
                        );
                        ?>
                        </span>
                                <button type="button" class="visibility-toggle-link" aria-describedby="<?php bp_the_profile_field_input_name(); ?>-2" aria-expanded="false"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></button>
                            </p>

                            <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
                                <fieldset>
                                    <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>

                                    <?php bp_profile_visibility_radio_buttons() ?>

                                </fieldset>
                                <button type="button" class="field-visibility-settings-close"><?php _e( 'Close', 'buddypress' ) ?></button>
                            </div>
                        <?php else : ?>
                            <div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
                                <?php
                                printf(
                                    __( 'This field can be seen by: %s', 'buddypress' ),
                                    '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>'
                                );
                                ?>
                            </div>
                        <?php endif ?>

                        <?php

                        /**
                         * Fires after the visibility options for a field.
                         *
                         * @since 1.1.0
                         */
                        do_action( 'bp_custom_profile_edit_fields' ); ?>

                    </fieldset>
                </div>

            <?php endwhile; ?>

            <?php

            /** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
            do_action( 'bp_after_profile_field_content' ); ?>

            <div class="submit">
                <input type="submit" name="profile-group-edit-submit" id="profile-group-edit-submit" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?> " />
            </div>

            <input type="hidden" name="field_ids" id="field_ids" value="<?php bp_the_profile_field_ids(); ?>" />

            <?php wp_nonce_field( 'bp_xprofile_edit' ); ?>

        </form>

    <?php endwhile; endif; ?>

<?php

/**
 * Fires after the display of member profile edit content.
 *
 * @since 1.1.0
 */
do_action( 'bp_after_profile_edit_content' );


}

0 个答案:

没有答案