sai-to3’s WEB開発メモ

WEB作り用にめもめも

BuddyPress:プロフィールで見せる値を変えたい!

GianismでFacebookから会員登録を促すと、IDが自動でつくられている。

そうすると、長ったらしい数字列になってしまうんだけどそれが「@123456789」とかでプロフィール画面に見えてきちゃう。

カッコ悪いよ〜〜

見せたくないよ〜〜〜

ということで、初めは自動生成のIDをなんとかカッコよくできないかと思ったんだけど、絶対被らないIDが作られてるからそれを変えると後々面倒になりそうだと思い。

表示する値を変えたほうがいいんじゃないかと、ファイルを解読しているところ。

 

今のところ有力そうなのが見つかった。

1:場所:wp-content/plugins/buddypress/bp-themes/bp-default/functions.php

809行~

* Ensure that multiselect boxes have trailing brackets in their 'id' and 'name' attributes.
*
* These brackets are required for an array of values to be sent in the POST
* request. Previously, bp_get_the_profile_field_input_name() contained the
* necessary logic, but since BP 2.0 that logic has been moved into
* BP_XProfile_Field_Type_Multiselectbox. Since bp-default does not use the
* BP_XProfile_Field_Type classes to build its markup, it did not inherit
* the brackets from their new location. Thus this workaround.

 

 「 bp_get_the_profile_field_input_name()」から引っ張ってきてるのか?

「 BP_XProfile_Field_Type_Multiselectbox」というのも。

BP_XProfileってファイルあったな。そこにあるの?

 

2:場所:wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php(ここもメモ)

 

〜〜追記〜〜

Webページで検証してみたらこの部分かと思うものが!

<div id="item-header" role="complementary">

 

<div id="cover-image-container">
<a id="header-cover-image" href="http://blueoceanz.biz/member/saito01/"></a>

<div id="item-header-cover-image">
<div id="item-header-avatar">
<a href="http://blueoceanz.biz/member/saito01/">

<img src="http://blueoceanz.biz/wp-content/uploads/avatars/1/5804c2db36f24-bpfull.jpg" class="avatar user-1-avatar avatar-150 photo" width="150" height="150" alt="自分 さんのプロフィール写真">
</a>
</div><!-- #item-header-avatar -->

<div id="item-header-content">

<h2 class="user-nicename">@saito01</h2>

<div id="item-buttons"></div><!-- #item-buttons -->

<span class="activity">6時間前</span>


<div id="item-meta">


<div id="latest-update">

アクティブ内容

<a href="http://blueoceanz.biz/activity/p/6/" rel="nofollow">表示</a>
</div>



</div><!-- #item-meta -->

</div><!-- #item-header-content -->

</div><!-- #item-header-cover-image -->
</div><!-- #cover-image-container -->


<div id="template-notices" role="alert" aria-atomic="true">

</div>

</div>

読み込んでるファイルの場所がわかった。

wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress-functions.php