Digitalraindrops

editedByCoz!

Sep 26th, 2010
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. /* Start Get Author Link */
  2. function my_authors_meta($atts){
  3. ob_start();
  4.         /* If the user passed an integer then good to go */
  5.         if (is_numeric($atts[0])) {
  6.                 $authorid = $atts[0];
  7.                 echo '<a href="';
  8.                 echo get_bloginfo('url');
  9.                 echo '/author/';
  10.                 echo the_author_meta('user_nicename', $authorid );
  11.                 echo '/">';
  12.                 echo the_author_meta('display_name', $authorid );
  13.         echo '</a>';
  14.         }
  15. $output_string = ob_get_contents();
  16. ob_end_clean();
  17. return $output_string;
  18. }
  19. add_shortcode('author', 'my_authors_meta');
  20. add_filter('my_authors_meta', 'do_shortcode');
  21. /* Start Get Author Link call [author id] */
Advertisement
Add Comment
Please, Sign In to add comment