# copy-the-code/5.5.4/includes/third-party/class-wpdatatables.php

Copy Anything to Clipboard for WordPress – Copy Button, Copy Text &amp; Copy Code, version 5.5.4. 41 lines.

- Page: https://pluginprobe.com/plugins/copy-the-code/5.5.4/code/includes/third-party/class-wpdatatables.php
- Raw: https://pluginprobe.com/plugins/copy-the-code/5.5.4/raw/includes/third-party/class-wpdatatables.php
- Modified: 2026-04-23T06:34:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/copy-the-code/5.5.4/code/includes/third-party/class-wpdatatables.php#L10-L20`.

```php
<?php
/**
 * WPDataTables integration.
 *
 * Registers the wpDataTables shortcode as a container so that `[copy]`
 * inside table cells trigger script enqueue and work with cached/dynamic table output.
 *
 * @package CTC
 * @since 5.5.1
 */

namespace CTC\ThirdParty;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class WPDataTables
 */
class WPDataTables {

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_filter( 'ctc/shortcode/container_shortcodes', [ $this, 'add_container_shortcodes' ], 10, 1 );
	}

	/**
	 * Add wpDataTables shortcode to the list of container shortcodes.
	 *
	 * @param string[] $container_shortcodes List of shortcode names that may output [copy] in their content.
	 * @return string[] Modified list.
	 */
	public function add_container_shortcodes( $container_shortcodes ) {
		$container_shortcodes[] = 'wpdatatable';
		return $container_shortcodes;
	}
}

```
