如何在Wordpress用户部分中添加新选项卡和数据

时间:2016-01-01 04:58:00

标签: php wordpress

我必须在wordpress用户中添加新标签和新数据。请看下面的图片。

Screetshot

点标签来自插件mycred,但我不知道使用了什么。我认为这是使用以下方式完成的:

$tabs = apply_filters( 'mycred_edit_profile_tabs', $tabs, $user, false );

do_action( 'mycred_edit_profile', $user, $type );

我希望在我的functions.php。

中使用此代码

1 个答案:

答案 0 :(得分:1)

您可以通过以下方式添加新标签:

    $tabs[] = array(
        'label'   => __( 'Profile', 'mycred' ),
        'url'     => 'some-url.php',
        # optionally some class for active tab
        'classes' => ( $current === NULL ) ? 'nav-tab nav-tab-active' : 'nav-tab'
    );