好的,我想我已经通过WP用户头像插件实现了。
我将此添加到我的登录配置文件表单的主题中。php,复制到我的主题文件夹的根目录。
<?php
global $current_user;
get_currentuserinfo();
do_action(\'edit_user_avatar\', $current_user);
?>
然后我将其添加到我的函数中。php文件:
function my_avatar_filter() {
// Remove from show_user_profile hook
remove_action(\'show_user_profile\', array(\'wp_user_avatar\', \'wpua_action_show_user_profile\'));
remove_action(\'show_user_profile\', array(\'wp_user_avatar\', \'wpua_media_upload_scripts\'));
// Remove from edit_user_profile hook
remove_action(\'edit_user_profile\', array(\'wp_user_avatar\', \'wpua_action_show_user_profile\'));
remove_action(\'edit_user_profile\', array(\'wp_user_avatar\', \'wpua_media_upload_scripts\'));
// Add to edit_user_avatar hook
add_action(\'edit_user_avatar\', array(\'wp_user_avatar\', \'wpua_action_show_user_profile\'));
add_action(\'edit_user_avatar\', array(\'wp_user_avatar\', \'wpua_media_upload_scripts\'));
}
// Loads only outside of administration panel
if(!is_admin()) {
add_action(\'init\',\'my_avatar_filter\');}
一切似乎都按预期进行:)