More Info for User Profile in WordPress
In the default wordpress user information can not meet all our needs, especially page wordpress user hierarchy and other information in addition to the default information in wordpress, for example, notes in the user such.
In this article I will guide you to create the Export your movie to your information for yourself or for members of your site.
You copy the code below and paste into the functions.php file offline
<?php
add_action( 'show_user_profile', 'extra_user_profile_fields' );
function extra_user_profile_fields( $user )
{
if ( current_user_can( 'administrator' ))
{?>
<h3><?php _e("Dung Lượng Cho User", "blank"); ?></h3>
<table>
<tr>
<th><label for="address"><?php _e("Dung Lượng"); ?></label></th>
<td>
<input type="text" name="dungluong" id="dungluong" value="<?php echo esc_attr( get_the_author_meta( 'dungluong', $user->ID ) ); ?>" /> Mb<br />
<span><?php _e("Hãy nhập dung lượng cần thay đổi của user vào."); ?></span>
</td>
</tr>
</table>
<?php }
}
add_action( 'edit_user_profile_update', 'save_extra_user_profile_fields' );
function save_extra_user_profile_fields( $user_id )
{
if ( !current_user_can( 'administrator' )) { return false; }
update_user_meta( $user_id, 'dungluong', $_POST['dungluong'] );
}
?>
Here’s an example to note the size of the user, this time before you stuff the user, so I have more decentralization line “if (current_user_can (‘administrator’))”, the only one I see it , and the user can not see, if you want all users to see you leave this condition.
In function “save_extra_user_profile_fields” I add the condition “if (! Current_user_can (‘administrator’))”, if not the admin, they will not save this Export your movie information. member if you want to change this shall give dingf conditions go.
Have you tested? that like? Install this before I used to allocate resources to upload wordpress, sat passively post up to share their experiences with the brothers.
Sure to guide the always all storage limit for user always full house. To post home.
In wordpress has all what we need, this is the advanced knowledge in wordpress, but you absolutely can easily and very quickly.
You and I have to start somewhere, and I’ve started from the number 0. You will do it all if you tried.
If you copy my post, please remember to link the source to me.
This article is useful for you, press like on my help, encourage writing.
Làm cách nào úp tin ẩn trong Wp được không bạn , mình muốn up tin trong trang của mình ALoTech.vn
up tin ẩn là sao bạn? mình vẫn chưa rõ ý bạn muốn nói đến là gì? ý bạn là phân quyền cho các user không thấy được tin tức của nhau hay như thế nào?
Nếu bạn muốn nói đến việc up tin không cho khách truy cập thấy được thig trong lúc bạn soạn bài viết bạn chọn “Visibility” là “draft” hoặc là “Password protected”