# copy-the-code/5.5.4/includes/elementor/widgets/copy-button/widget.php

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

- Page: https://pluginprobe.com/plugins/copy-the-code/5.5.4/code/includes/elementor/widgets/copy-button/widget.php
- Raw: https://pluginprobe.com/plugins/copy-the-code/5.5.4/raw/includes/elementor/widgets/copy-button/widget.php
- Modified: 2026-02-01T23:32:30+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/elementor/widgets/copy-button/widget.php#L10-L20`.

```php
<?php
/**
 * Elementor Copy Button Block
 *
 * @package CTC
 * @since 5.0.0
 */

namespace CTC\Elementor\Block;

use CTC\Helpers;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;

/**
 * Copy Button Block
 *
 * @since 5.0.0
 */
class CopyButton extends Widget_Base {

	/**
	 * Constructor
	 *
	 * @param array $data
	 * @param array $args
	 *
	 * @since 5.0.0
	 */
	public function __construct( $data = [], $args = null ) {
		parent::__construct( $data, $args );
	}

	/**
	 * Get name
	 */
	public function get_name() {
		return 'ctc_copy_button';
	}

	/**
	 * Get title
	 */
	public function get_title() {
		return esc_html__( 'Copy to Clipboard Button', 'ctc' );
	}

	/**
	 * Get icon
	 */
	public function get_icon() {
		return 'eicon-button';
	}

	/**
	 * Get categories
	 */
	public function get_categories() {
		return Helpers::get_categories();
	}

	/**
	 * Get keywords
	 */
	public function get_keywords() {
		return Helpers::get_keywords( [ 'copy', 'button', 'clipboard', 'copy button', 'clipboard button' ] );
	}

	/**
	 * Render
	 */
	public function render() {
		?>
		<div class="ctc-block ctc-copy-button">
			<div class="ctc-block-actions">
				<?php
					Helpers::render_copy_button( $this );
				?>
			</div>
			<?php Helpers::render_copy_content( $this ); ?>
		</div>
		<?php
	}

	/**
	 * Register controls
	 */
	protected function _register_controls() {
		Helpers::register_copy_content_section( $this );

		Helpers::register_copy_button_section( $this );

		Helpers::register_copy_button_style_section( $this );
	}
}

```
