01取得現在用戶的相關資料

[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 />’;
[/php]
Screen_Shot_2015-12-26_at_5_06_06_PM

wordpress
CH02用戶資料CH03基本APICH05 分類頁面Category.phpCH09Screen Options(顯示選項)CH10外掛pluginsCH11 add_actionCH12 add_filterCH13Meta Box(自訂區塊)CH14widget(自訂模組)CH15 DBCH16AJAXCH17ShortcodeCH20 wordpress muCH30WooCommerce