Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Kupası
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPress’te Kullanıcı Kayıt Tarihi Nasıl Gösterilir

WordPress’te kullanıcı kayıt tarihini göstermek ister misiniz? Genellikle popüler üyelik siteleri ve forumlar kullanıcı kayıt tarihini profilde “2015’ten beri üye” olarak gösterir. Bu makalede, WordPress’te kullanıcı kayıt tarihinin nasıl gösterileceğini ele alacağız.

Showing a the date of a user's registration in WordPress

Kullanıcı Kayıt Tarihini Nerede ve Nasıl Göstermek İstiyorsunuz?

Bazılarınız sadece bir kullanıcının kayıt tarihini Kullanıcılar sayfasının yönetici sütunlarında görüntülemek isteyebilir. Bu, bir kullanıcının web sitenize ne zaman katıldığına dair hızlı bir genel bakış sağlar ve kayıt tarihine göre sıralama yapmanıza olanak tanır.

Bir başka kullanım senaryosu da bir kullanıcının kayıt tarihini ‘Profili Düzenle’ sayfasında görüntülemektir. Bu, herhangi bir yöneticinin ve kullanıcının kendisinin web sitenize ne zaman katıldığını görmesini sağlayacaktır.

Son ama muhtemelen en popüler kullanım senaryosu, web sitenizin ön ucundaki herkese açık profillerinde kullanıcı kayıt tarihini görüntülemek istediğiniz zamandır.

Şimdi bunların hepsini nasıl yapabileceğinize bir göz atalım.

Yönetici Alanındaki Kullanıcılar Sayfasına Kayıt Tarihi Sütunu Ekleme

Yapmanız gereken ilk şey Admin Columns eklentisini kurmak ve etkinleştirmektir. Etkinleştirdikten sonra, eklentiyi yapılandırmak için Ayarlar “ Yönetici Sütunları’nı ziyaret etmeniz gerekir.

Add registered column in users table

Yönetici sütunları sekmesi altında, kullanıcılara tıklayın ve ardından sütun ekle düğmesine tıklayın.

Ardından Tür açılır menüsünden ‘Kayıtlı’ seçeneğini seçin ve güncellemeleri depola düğmesine tıklayın.

Artık kullanıcılar ekranını ziyaret edebilir ve burada bir kullanıcının WordPress sitenize kaydolduğu tarihi gösteren ‘Kayıtlı’ etiketli yeni bir sütun görebilirsiniz.

Users table with registration date column

WordPress’te yönetici sütunları eklemek ve özelleştirmek için başka neler yapabileceğinizi görün.

Kullanıcı Profilinde Kayıt Tarihi Alanını Gösterme

Profil düzenleme sayfasında kayıt tarihini göstermek için web sitenize özel bir eklenti yüklemeniz gerekecektir.

Notepad gibi bir metin düzenleyici kullanarak bilgisayarınızda yeni bir dosya oluşturun ve masaüstünüze membersince.php olarak kaydedin.

Ardından dosyayı açın ve aşağıdaki kodu içine yapıştırın.

<?php
/*
Plugin Name: Member Since
Plugin URI:  https://www.wpbeginner.com
Description: Adds registration date on edit user profile screen. 
Version:     1.0
Author:      WPBeginner
*/


namespace ShowMemberSince;
add_action( 'plugins_loaded', 'ShowMemberSince\init' );
/**
 * Adding needed action hooks
*/
function init(){
  foreach( array( 'show_user_profile', 'edit_user_profile' ) as $hook )
		add_action( $hook, 'ShowMemberSince\add_custom_user_profile_fields', 10, 1 );
}
/**
 * Output table
 * @param object $user User object
 */
function add_custom_user_profile_fields( $user ){
	$table =
	'<h3>%1$s</h3>
	<table class="form-table">
		<tr>
			<th>
				%1$s
			</th>
			<td>
				<p>Member since: %2$s</p>
			</td>
		</tr>
	</table>';
	$udata = get_userdata( $user->ID );
	$registered = $udata->user_registered;
	printf(
		$table,
		'Registered',
		date( "M Y", strtotime( $registered ) )
	);
}
?>

Dosyanızı kaydedin ve ardından WordPress sitenize yükleyin.

Son olarak bir FTP istemcisi kullanarak WordPress sitenize bağlanabilir ve ardından /wp-content/plugins/ klasörüne gidebilirsiniz. Bilgisayarınızdan membersince.php dosyasını seçin ve ardından yükleyin.

Şimdi WordPress eklentileri sayfanıza gidebilir ve bu eklentiyi web sitenizde etkinleştirebilirsiniz.

Hepsi bu kadar. WordPress yönetici alanınızda bir kullanıcı profilini düzenleyerek her şeyin çalıştığını doğrulayın ve kullanıcı kayıt tarihini göreceksiniz.

Showing member registration date in WordPress user profile

Web Sitenizde Kullanıcı Kayıt Tarihini Gösterme

Bu yöntemde, WordPress sitenizin ön ucunda herhangi bir kullanıcının kayıt tarihini görüntülemek için basit bir kısa kod kullanacağız.

Öncelikle aşağıdaki kodu temanızın functions.php dosyasına veya siteye özel bir eklentiye eklemeniz gerekecektir.


function wpb_user_registration_date($atts, $content = null ) { 

$userlogin = shortcode_atts( array(
'user' => FALSE,
), $atts );

$uname = $userlogin['user'];     

if ($uname!== FALSE) {             

$user = get_user_by( 'login', $uname );  
if ($user == false) { 

$message ='Sorry no such user found.'; 


} else { 

$udata = get_userdata( $user-ID );
$registered = $udata->user_registered;

$message =	'Member since: ' . date( "d F Y", strtotime( $registered ) );

}
	
} else { 

$message = 'Please provide a username.'; 

} 

return $message; 

} 

add_shortcode('membersince', 'wpb_user_registration_date');

Ardından, aşağıdaki gibi bir kısa kod kullanarak kullanıcının kayıt tarihini görüntüleyebilirsiniz:

[membersince user=peter]

Peter yerine göstermek istediğiniz kullanıcı adını yazın.

Umarız bu makale WordPress kullanıcı profillerinde kayıt tarihini göstermenize yardımcı olmuştur. WordPress kaydında ek kullanıcı profili alanlarının nasıl ekleneceğine ilişkin eğitimimizi de görmek isteyebilirsiniz.

Bu makaleyi beğendiyseniz, WordPress video eğitimleri için lütfen YouTube Kanalımıza abone olun. Bizi Twitter ve Facebook‘ta da bulabilirsiniz.

Açıklama: İçeriğimiz okuyucu desteklidir. Bu, bazı bağlantılarımıza tıklarsanız komisyon kazanabileceğimiz anlamına gelir. WPBeginner'ın nasıl finanse edildiğini, neden önemli olduğunu ve nasıl destek olabileceğinizi görün. İşte editoryal sürecimiz.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Ultimate WordPress Araç Kiti

Araç setimize ÜCRETSİZ erişim sağlayın - her profesyonelin sahip olması gereken WordPress ile ilgili ürün ve kaynaklardan oluşan bir koleksiyon!

Reader Interactions

18 yorumBir Cevap Bırakın

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Tom says

    Hello :) Nice code thank you but is it possible with the shortcode to show the register date of the user which actually logged in?

  3. Ralph says

    TYPO: There is one typo in the code in method 3 that results in the error of date always showing the same value: On line 37 is
    $udata = get_userdata( $user-ID );

    while it should be:
    $udata = get_userdata( $user->ID );

    (Notice the arrow instead of the dash)

  4. chergui djaouida says

    please i need to introduce the date of registration of a user in a php code not by a shortcode how to do?

  5. Isabelle Laplante says

    «Showing Registration Date Field in User Profile» costum Plugin works but do not show the real date… For every users, the added information is«Member since: Jun 2015» … Wich is not the case… Can you help?

  6. Jody Hockley says

    Hi,

    Thanks for the plugin, nice easy fix for a simple problem.

    I have just used the second option to show in the User profile page. However it only show month and year, not the day. How would I alter the plugin code to show the day too?

    Thanks for your help, much appreciated

    Jody

  7. Gerard says

    Very nice :).
    I needed only first code snippet (which works).
    Just one little note: on line 37 you should make it ‘$user->ID” you forgot the ‘>’, else it shows notices when debuggin.

    Thank you.

  8. Davis says

    Admin Columns plugin developer requires $60US to sort by registration date. If you are a site manager, find a better solution. WP should include this ultra-basic functionality in all WP installs.

  9. Hemang Rindani says

    Insightful article. WordPress is the most user friendly CMS that can create complex websites with very less or no technical knowledge. It comes with rich set of modules and plugins that can transform your digital dream into a reality. However, it is important to identify the secured and authenticated tools for your WordPress website to improve the overall website security. WP is capable of handling multiple sites with multiple users which has been a requirement of big organizations. WP provides some great features to manage user accounts and prevent the website from unauthorized access using certain plugins with your website. There are also tools to enhance the user experience like the one described in the article to provide a great personal feel to the user.

    Thanks for the article.

  10. Patrick Catthoor says

    This looked like a feature I could use for my website. So, I tried all 3 methods.
    Method 1 works like a charm, but both methods 2 and 3 always provide the same date: 01 January 1970. Something must be wrong, but I couldn’t figure out what.
    Any ideas?

    • Celito C. Macachor says

      I realize this is an old issue, but I just came across this article after a recent search. Great, insightful articles, but I have the same concern as Patrick’s. In the all users list, the registration date is correct. While it is not critical, only one date (July 2016) is shown for all users in the Member since field. Has this issue been resolved? Thanks for any updated information.

Bir Cevap Bırakın

Yorum bırakmayı seçtiğiniz için teşekkür ederiz. Lütfen tüm yorumların yorum poli̇ti̇kasi uyarınca denetlendiğini ve e-posta adresinizin yayımlanmayacağını unutmayın. Ad alanında anahtar kelime KULLANMAYIN. Kişisel ve anlamlı bir sohbet edelim.