- Я удалил и добавил некоторые поля на странице профиля пользователя WP, используя php-коды в файле function.php:
Код: Выделить всё
if ( ! function_exists( 'modify_profile_fields' ) ) : function modify_profile_fields( $contactmethods ) { unset($contactmethods['facebook']); unset($contactmethods['youtube']); unset($contactmethods['linkedin']); unset($contactmethods['instagram']); unset($contactmethods['myspace']); unset($contactmethods['twitter']); unset($contactmethods['pinterest']); unset($contactmethods['soundcloud']); unset($contactmethods['tumblr']); unset($contactmethods['wikipedia']); $contactmethods['phone1'] = __( 'Phone 1' ); $contactmethods['phone2'] = __( 'Phone 2' ); $contactmethods['phone3'] = __( 'Phone 3' ); $contactmethods['telegram1'] = __( 'Telegram username' ); return $contactmethods; } add_filter('user_contactmethods','modify_profile_fields', 10, 1); endif;
- Однако возникают ошибки при отображении значения поля Telegram, когда я пытаюсь получить данные всех 4 последних полей: phone1, phone2, phone3 и telegram1 со следующими кодами на одной странице Wordpress (одна .php):
Код: Выделить всё
Код: Выделить всё
{if !empty($author_phone1)}
[i][/i][url=tel:{$phone_display1}] Call[/url]
{/if}
{if !empty($telegram_username1)}
[i][/i][url=https://t.me/{$telegram_username1}] Chat[/url]
{/if}
Код: Выделить всё
Call Chat
При наведении курсора мыши или нажатии кнопки «Чат» отображается или осуществляется переход по адресу: https. ://t.me/Array - это означает, что приведенные выше php-коды не извлекают значение поля Telegram1 или что-то не так с фигурными кодами?
Будем благодарны за любую поддержку.
Подробнее здесь: https://stackoverflow.com/questions/786 ... ofile-page