Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_comment_author_link( $comment_ID = 0 ) {
- /** @todo Only call these functions when they are needed. Include in if... else blocks */
- $url = get_comment_author_url( $comment_ID );
- $author = get_comment_author( $comment_ID );
- if ( empty( $url ) || 'http://' == $url )
- $return = $author;
- else
- $return = "<a class="url" href="$url" rel="external nofollow" data-mce-href="$url">$author</a>";
- return apply_filters('get_comment_author_link', $return);
- }
- ================================================================================================================================
- /**
- * Ссылка на сайт комментатора без тега a
- * @param int $comment_ID
- * @return string
- */
- function get_my_comment_author_link( $comment_ID = 0 ) {
- $url = get_comment_author_url( $comment_ID );
- $author = get_comment_author( $comment_ID );
- if ( empty( $url ) || 'http://' == $url )
- $return = $author;
- else
- $return = "<span class=\"author-url\" data-url=\"$url\">$author</span>";
- return $return;
- }
- ==========================================================================================
- printf( '<cite class="fn" itemprop="creator">%1$s</cite>',
- get_my7_comment_author_link(),
- // Adds Post Author to comments posted by the article writer
- ( $comment->user_id === $post->post_author ) ? '<span> ' . __( 'Post author', 'themonic' ) . '</span>' : ''
- );
- ===================================================================
- При совпадении в последнем коде должна использоваться функция get_my7_comment_author_link(). Иначе get_comment_author_link().
- get_my7_comment_author_link() маскирует ссылки от поисковиков
- get_comment_author_link() выводит стандартную открытую ссылку
- Получается что то типа белого списка. Указанные адреса (их несколько будет скорее всего) не маскируются, все остальные с маскировкой через функцию get_my7_comment_author_link().
- Или я много хочу и так нельзя?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement