ghenzdeveloper

Untitled

Jan 1st, 2023
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | Source Code | 0 0
  1. add_filter( "adverts_tpl_single_posted_by", function($content, $post_id) {
  2.     $post = get_post($post_id);
  3.     if($post){
  4.         $profile_url = '#';
  5.         if(class_exists('PeepSoUser')){
  6.             $PeepSoUser = PeepSoUser::get_instance($post->post_author);
  7.             $profile_url = $PeepSoUser->get_profileurl();
  8.         }
  9.         $content = sprintf( __("by <a href='{$profile_url}'><strong>%s</strong></a>", "wpadverts"), esc_html( get_post_meta($post_id, 'adverts_person', true) ) );
  10.     } else {
  11.         $content =  "<span style='color:red'> Guest <strong>%s</strong></span>";
  12.     }
  13.  
  14.     return $content;
  15.  
  16. }, 99, 2);
Add Comment
Please, Sign In to add comment