/** * custom_columns function. * * @access public * @param mixed $column * @return void */ public function custom_columns($column) { global $post, $download_monitor; $download = new DLM_Download($post->ID); $file = $download->get_file_version(); switch ($column) { case "thumb": echo $download->get_the_image(); break; case "download_id": echo $post->ID; break; case "download_cat": if (!($terms = get_the_term_list($post->ID, 'dlm_download_category', '', ', ', ''))) { echo '<span class="na">–</span>'; } else { echo $terms; } break; case "download_tag": if (!($terms = get_the_term_list($post->ID, 'dlm_download_tag', '', ', ', ''))) { echo '<span class="na">–</span>'; } else { echo $terms; } break; case "featured": if ($download->is_featured()) { echo '<span class="yes">' . __('Yes', 'download-monitor') . '</span>'; } else { echo '<span class="na">–</span>'; } break; case "members_only": if ($download->is_members_only()) { echo '<span class="yes">' . __('Yes', 'download-monitor') . '</span>'; } else { echo '<span class="na">–</span>'; } break; case "redirect_only": if ($download->redirect_only()) { echo '<span class="yes">' . __('Yes', 'download-monitor') . '</span>'; } else { echo '<span class="na">–</span>'; } break; case "file": if ($file) { echo '<a href="' . $download->get_the_download_link() . '"><code>' . $file->filename; if ($size = $download->get_the_filesize()) { echo ' – ' . $size; } echo '</code></a>'; } else { echo '<span class="na">–</span>'; } break; case "version": if ($file && $file->version) { echo $file->version; } else { echo '<span class="na">–</span>'; } break; case "download_count": echo number_format($download->get_the_download_count(), 0, '.', ','); break; case "featured": if ($download->is_featured()) { echo '<img src="' . $download_monitor->plugin_url() . '/assets/images/on.png" alt="yes" />'; } else { echo '<span class="na">–</span>'; } break; } }