edit user profile - Action介绍
2015-05-17 15:58
253 查看
原文:Plugin API/Action Reference/edit user profile
这个钩子只有在用户编辑其他用户的属性时候才会触发(不是当前登录用户)。如果需要所有用户编辑页面都会触发事件,那应该使用
(
默认:
Action介绍
这个Action钩子通常会在用户属性编辑页面需要输出新的字段或者在编辑页面底部添加更多内容的时候会使用到。这个钩子只有在用户编辑其他用户的属性时候才会触发(不是当前登录用户)。如果需要所有用户编辑页面都会触发事件,那应该使用
show_user_profile钩子。
参数
$user(
object) (
optional) 当前被正在被编辑的用户。
默认:
None
例子
/** * Show custom user profile fields * @param obj $user The user object. * @return void */ function numediaweb_custom_user_profile_fields($user) { ?> <table class="form-table"> <tr> <th> <label for="tc_location"><?php _e('Location'); ?></label> </th> <td> <input type="text" name="tc_location" id="tc_location" value="<?php echo esc_attr( get_the_author_meta( 'tc_location', $user->ID ) ); ?>" class="regular-text" /> <br><span class="description"><?php _e('Your location.', 'travelcat'); ?></span> </td> </tr> <tr> <th> <label for="tc_favorites"><?php _e('Favorites', 'travelcat'); ?></label> </th> <td> <input type="text" name="tc_favorites" id="tc_favorites" value="<?php echo esc_attr( get_the_author_meta( 'tc_favorites', $user->ID ) ); ?>" class="regular-text" /> <br><span class="description"><?php _e('Can you share a few of your favorite places to be or to stay?', 'travelcat'); ?></span> <br><span class="description"><?php _e('Separate by commas.', 'travelcat'); ?></span> </td> </tr> <tr> <th> <label for="tc_travel_map"><?php _e('Travel map', 'travelcat'); ?></label> </th> <td> <input type="text" name="tc_travel_map" id="tc_travel_map" value="<?php echo esc_attr( get_the_author_meta( 'tc_travel_map', $user->ID ) ); ?>" class="regular-text" /> <br><span class="description"><?php _e('Been there / Going there within a year / Wish list.', 'travelcat'); ?></span> <br><span class="description"><?php _e('Separate by commas.', 'travelcat'); ?></span> </td> </tr> </table> <?php } add_action('show_user_profile', 'numediaweb_custom_user_profile_fields'); add_action('edit_user_profile', 'numediaweb_custom_user_profile_fields');
源文件
edit_user_profile钩子的源文件在 /wp-admin/user-edit.php
相关文章推荐
- 详细介绍"使用DB Attach的方式来升级MOSS2007中SSP的user profile和mysite至SharePoint 2010"的文章
- ToEditUserAction
- SaveEditUserAction
- Infomation Module Profile介绍
- 监听屏幕 android.intent.action.USER_PRESENT
- MOSS 2013学习研究系列---User Profile 同步
- android性能分析工具Profile GPU rendering详细介绍
- Exception occurred during processing request: com.hry.shop.user.action.UserAction.findByName()
- oracle EBS User Profile使用举例
- DisplayAllUserAction
- MOSS User Profile(一):获取和遍历
- 在MOSS的WebPart中使用UserProfile注意事项
- MOSS User Profile(四):代码创建用户配置文件
- [转]ASP.NET MVC 入门9、Action Filter 与 内置的Filter实现(介绍)
- Action介绍
- 【转】Import User Profile Photos from Active Directory into SharePoint 2010
- GreenDao 报错 .sqlite.SQLiteConstraintException: UNIQUE constraint failed: user_profile._id (code 1555
- Elevate Permissions To Modify User Profile
- User Profile Service Stuck on Starting --用户配置文件停在“启动中”
- User Profile Synchronization Service–Hangs on Starting (I fixed it!) 用户配置文件同步服务卡在“正在启动”状态