wpdatatables_enqueue_on_frontend

Contents

Description

The wpdatatables_enqueue_on_frontend action is triggered after all required scripts and styles for wpDataTables are enqueued on the frontend. This allows you to enqueue additional scripts or styles.

Usage

add_action('wpdatatables_enqueue_on_frontend', 'my_enqueue_custom_scripts', 10, 1);

Parameters

  • $this object
    The current table object instance for which the scripts and styles are enqueued.

Examples

// Example: Enqueue a custom script after wpDataTables frontend scripts
function my_enqueue_custom_scripts($table_instance) {
    wp_enqueue_script(
        'my-custom-frontend-script',
        plugin_dir_url(__FILE__) . 'assets/js/custom-frontend.js',
        array('jquery'),
        '1.0.0',
        true
    );
}
add_action('wpdatatables_enqueue_on_frontend', 'my_enqueue_custom_scripts', 10, 1);