• I added the code to add a link of the elements in the column “Cod.prodotto” (meta key: cod_prodotto), but I have to delete the elements without the code, now I have 2 identical elements one near the other, one linked the other not: https://pastebin.com/2BNcHzWC

    I’m using the free version of Admin column, any suggestion for developing?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    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.

    Thread Starter sacconi

    (@sacconi)

    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 🙁

    Thread Starter sacconi

    (@sacconi)

    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
Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.