wpdatatables_curl_get_data

Contents

Description

This filter allows you to modify or replace the data fetched by the cURL request in wpDataTables. It provides flexibility to preprocess the data or implement a custom data retrieval method.

Usage

add_filter( 'wpdatatables_curl_get_data', 'custom_curl_data_handler', 10, 3 );

Parameters

  • $data mixed
    The default value is `null`. This represents the data returned by the cURL request. If the filter returns `null`, the default cURL execution will proceed.
  • $ch resource
    The cURL handle used to execute the request. This allows modification of cURL options before execution.
  • $url string
    The URL that the cURL request is attempting to retrieve data from.

Examples

// Callback function for the wpdatatables_curl_get_data filter hook
function custom_curl_data_handler($data, $ch, $url) {
    // Modify cURL options
    curl_setopt($ch, CURLOPT_TIMEOUT, 200);

    return $data;
}

add_filter( 'wpdatatables_curl_get_data', 'custom_curl_data_handler', 10, 3 );