Wordpress Yorum Yazar Bağlantı

2 Cevap php

Eğer misafir olarak yorum bıraktığınızda wordpress formda, web adresi doldurmak için bir web sitesi alan var. Biz bu kutuya doldurun, biz bu işlevi çağırarak bağlantıyı alabilirsiniz

<?php echo get_comment_author_link(); ?>

Ama kaydediliyor ve yorum bırakmak ne zaman, profilinize web sitesi eklemek yoksa. Bu sizin adınızı linki yok.

Ne istediğiniz oturum açmış kullanıcı web sitesi yoksa, http://www.example.com?author=21 gibi bir şey olduğunu kendi profil sayfasında onları taşımak olacaktır bağlantı olacak, bir

Ben orada kullanabilirsiniz herhangi bir işlevi var mı? Bana yardım edin. Teşekkür ederim.

2 Cevap

Temanızın functions.php bu Bırak;

function force_comment_author_url($comment)
{
    // does the comment have a valid author URL?
    $no_url = !$comment->comment_author_url || $comment->comment_author_url == 'http://';

    if ($comment->user_id && $no_url) {
        // comment was written by a registered user but with no author URL
        $comment->comment_author_url = 'http://www.example.com/?author=' . $comment->user_id;
    }
    return $comment;
}
add_filter('get_comment', 'force_comment_author_url');

iyi i bir çözüm bir PHP / MySQL komut istediğiniz değere wordpress veritabanı boş bir veritabanı alanları güncellemek için sanırım