워드프레스 변수명 확인하기

게시일

작성자:

카테고리:

태그됨:

<?php
$current_user = wp_get_current_user();
/**
* @example Safe usage: $current_user = wp_get_current_user();
* if ( !($current_user instanceof WP_User) )
*     return;
*/
echo ‘Username: ‘ . $current_user->user_login . ‘<br />’;
echo ‘User email: ‘ . $current_user->user_email . ‘<br />’;
echo ‘User first name: ‘ . $current_user->user_firstname . ‘<br />’;
echo ‘User last name: ‘ . $current_user->user_lastname . ‘<br />’;
echo ‘User display name: ‘ . $current_user->display_name . ‘<br />’;
echo ‘User ID: ‘ . $current_user->ID . ‘<br />’;
?>

위와 같이 하면 변수명을 확인할 수 있다.

출처 : https://codex.wordpress.org/ko:%ED%95%A8%EC%88%98_%EB%A0%88%ED%8D%BC%EB%9F%B0%EC%8A%A4/wp_get_current_user#.EB.A6.AC.ED.84.B4_.EA.B0.92

작성일자 : 2017.09.30

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다