HEX
Server: nginx/1.28.0
System: Linux yisu-68a5f20334161 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: www (1000)
PHP: 8.2.28
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/q.autos58.cn/wp-content/themes/morenews/inc/multi-author.php
<?php
if (!function_exists('morenews_by_author')) {
  function morenews_by_author($gravatar = '')
  {

    global $post;

    if (class_exists('WP_Post_Author')) {
      $post_id = $post->ID;
      $awpa_post_authors = get_post_meta($post_id, 'wpma_author');
      $enable_author_metabox_for_post = get_option('awpa_author_metabox_integration');
      $multiauthor_settings = false;
      if ($enable_author_metabox_for_post && $enable_author_metabox_for_post['enable_author_metabox'] == true) {
        $multiauthor_settings = true;
      }
      if (isset($awpa_post_authors) && !empty($awpa_post_authors) && $multiauthor_settings == true) {
        foreach ($awpa_post_authors as $key => $author_id) {

          $needle = 'guest-';
          if (strpos($author_id, $needle) !== false) {
            $filter_id = substr($author_id, strpos($author_id, "-") + 1);
            $author_id = $filter_id;
            $author_type = 'guest';
          } else {
            $author_id = $author_id;
            $author_type = 'default';
          }

          morenews_author_list($post_id, $author_id, $author_type, $gravatar);
          if ($key != (count($awpa_post_authors) - 1)) {
            echo ",";
          }
        }
        
      } else {
        
        $author_id = $post->post_author;
        $author_name = get_the_author_meta('display_name', $author_id);

?>
        <a href="<?php echo esc_url(get_author_posts_url($author_id)) ?>">
          <?php if ($gravatar == true) {
            echo get_avatar(get_the_author_meta('user_email', $author_id), 16);
          } ?>
          <?php echo esc_html($author_name); ?>
        </a>
      <?php


      }
    } else {
      
      $author_id = $post->post_author;
      $author_name = get_the_author_meta('display_name', $author_id);
      ?>
      <a href="<?php echo esc_url(get_author_posts_url($author_id)) ?>">
      <?php if ($gravatar == true) {
            echo get_avatar(get_the_author_meta('user_email', $author_id), 16);
          } ?>
        <?php echo esc_html($author_name); ?>
      </a>
    <?php }
  }
}

if (!function_exists('morenews_author_list')) {
  function morenews_author_list($post_id = '', $author_id = '', $author_type = '', $gravatar = false)
  {
    if ($author_type == 'default') {
      $author_name = get_userdata($author_id);
      if ($author_name) {
        ?>
        <a href="<?php echo esc_url(get_author_posts_url($author_id)); ?>">
          <?php if ($gravatar == true) {
            echo get_avatar(get_the_author_meta('user_email', $author_id), 16);
          } ?>
          <?php echo esc_html($author_name->display_name); ?>
        </a>
        <?php
      }
    }

    if ($author_type == 'guest') {
      $wp_amulti_authors = new WPAMultiAuthors();
      $guest_user_data = $wp_amulti_authors->get_guest_by_id($author_id);
      if ($guest_user_data) {
        if ($gravatar == true) {
          echo get_avatar($guest_user_data->user_email, 150);
        }
        echo esc_html($guest_user_data->display_name);
      }
    }
  }
}