Assuming that function is the reason for both links, one possible explanation is that the “manage_post_posts_custom_column” action is firing more than once. It shouldn’t be, but actions firing more than once is a common enough occurrence. One way to avoid multiple calls of your function is to have it remove itself from the action call stack on initial entry.
This scenario does not explain why one element is not linked. If the same callback were responsible, both elements should have the same link. Thus I’m inclined to suspect another callback is responsible. There’s a simple test. Comment out the add_action() line. If both elements disappear, then the same function is responsible and perhaps the action is firing more than once. If only one element disappears, then there’s another callback somewhere that’s responsible.
The function is not responsible for both elements, first I populated all the posts with a temporary one-shot code, so I got the the elements without link, then I put the function to have the linked element, now I have both elements 🙁
Solution:
// Inizia la tua nuova aggiunta qui
add_filter( 'ac/column/value', 'suppress_admin_columns_cod_prodotto_output', 10, 3 );
function suppress_admin_columns_cod_prodotto_output( $value, $post_id, $column ) {
// !!! ASSOLUTAMENTE FONDAMENTALE !!!
// SOSTITUISCI '6a78488e20c49c' CON L'ID ESATTO DELLA TUA COLONNA ADMIN COLUMNS PER 'cod_prodotto'
// Questo ID deve essere lo stesso che usi nella tua funzione 'populate_cod_prodotto_column_with_link'
if ( $column->get_name() === '6a78488e20c49c' ) {
return ''; // Sopprime l'output predefinito di Admin Columns
}
return $value; // Permette ad altre colonne di AC di funzionare normalmente
}
// Fine della tua nuova aggiunta