• Resolved pipoulito

    (@pipoulito)


    Hi,

    Please what is the correct hook to cutom the render of a cell value ?

    (my value is an image ID and i have to apply get_the_post_thumbnail(value ) to display the image)

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author wpDataTables

    (@wpdatatables)

    Hello,
    Since you’re using the Premium version of the plugin, please open a ticket in the “Pre-Purchase” section on our official support platform, and we’ll gladly help you there.

    Premium products are not supported in these forums, as per this comment by ww.wp.xz.cn moderators.

    Thank you for understanding.

    Plugin Author wpDataTables

    (@wpdatatables)

    Hello again.
    Just to follow up on this, we found an example of a hook that you could use :

    function wpdatatables_filter_cell_by_column_name( $formattedValue, $tableId , $columnHeader)
    {
        // here you can set table id that you need
        // $tableId is int
        if ($tableId == 1) {
            // here you will insert orig header for columns where you need to change content
            // $columnHeader is string
            if ($columnHeader == "column_name" ) {
                // Here you will insert your logic
                $formattedValue = "your custom value";
            }
        }
        return $formattedValue;
    }
    add_filter('wpdatatables_filter_cell_output','wpdatatables_filter_cell_by_column_name', 10, 3);

    You can add this to your functions.php of the active Theme or child Theme.

    Please note that using hooks requires a certain level of programming skills and included support refers only to advice.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Hook to Alter cell value’ is closed to new replies.