wp_get_user_contact_methods()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
wp_get_user_contact_methods( WP_User|null $user = null ): string[]
Описание
Способы связи по умолчанию были убраны для новых установок в WordPress 3.6 и полностью удалены из кодовой базы в WordPress 6.9.
Используйте фильтр 'user_contactmethods' для добавления или удаления способов связи.
Оригинал (английский)
Default contact methods were removed for new installations in WordPress 3.6 and completely removed from the codebase in WordPress 6.9.
Use the ‘user_contactmethods’ filter to add or remove contact methods.
Параметры
$user
WP_User|null
необязательный
= null
Возвращаемое значение
string[]
Исходный код
wp-includes/user.php:3024
function wp_get_user_contact_methods( $user = null ) {
$methods = array();
/**
* Filters the user contact methods.
*
* @since 2.9.0
*
* @param string[] $methods Array of contact method labels keyed by contact method.
* @param WP_User|null $user WP_User object or null if none was provided.
*/
return apply_filters( 'user_contactmethods', $methods, $user );
}
История изменений
| Версия | Описание |
|---|---|
| 6.9.0 | Removed references to aim, jabber, and yim contact methods. |
| 3.7.0 | Introduced. |

