wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



get_current_user_id › WordPress Function

Od
Przestarzałyn/a
get_current_user_id ( Brak parametrów )
Powrót:
  • (int) The current user's ID, or 0 if no user is logged in.
Zdefiniowane na:
Codex:
Dziennik zmian:
  • MU

Gets the current user's ID.



Źródło

function get_current_user_id() {
	if ( ! function_exists( 'wp_get_current_user' ) ) {
		return 0;
	}
	$user = wp_get_current_user();
	return ( isset( $user->ID ) ? (int) $user->ID : 0 );
}