$columns Existing columns. * @return array Modified columns. */ public function add_columns( array $columns ): array { $new = []; foreach ( $columns as $key => $label ) { $new[ $key ] = $label; // Insert custom columns after the title column. if ( 'title' === $key ) { $new['pr_evidence'] = __( 'Evidence', 'peptide-repo-core' ); $new['pr_editorial'] = __( 'Editorial', 'peptide-repo-core' ); $new['pr_dosing'] = __( 'Dosing Rows', 'peptide-repo-core' ); } } return $new; } /** * Render custom column content for a peptide row. * * @param string $column Column key. * @param int $post_id Post ID. * @return void */ public function render_column( string $column, int $post_id ): void { switch ( $column ) { case 'pr_evidence': $strength = get_post_meta( $post_id, 'evidence_strength', true ) ?: 'preclinical'; $label = apply_filters( 'pr_core_evidence_strength_label', $strength, $strength ); echo esc_html( $label ); break; case 'pr_editorial': $status = get_post_meta( $post_id, 'editorial_review_status', true ) ?: 'draft'; echo esc_html( ucfirst( str_replace( '-', ' ', $status ) ) ); break; case 'pr_dosing': $count = ( new PR_Core_Dosing_Repository() )->count_by_peptide( $post_id ); echo esc_html( (string) $count ); break; } } }