# copy-the-code/3.8.2/classes/opt-in/opt-in.js

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

- Page: https://pluginprobe.com/plugins/copy-the-code/3.8.2/code/classes/opt-in/opt-in.js
- Raw: https://pluginprobe.com/plugins/copy-the-code/3.8.2/raw/classes/opt-in/opt-in.js
- Modified: 2022-12-25T19:14:00+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/3.8.2/code/classes/opt-in/opt-in.js#L10-L20`.

```javascript
(function($) {

    CopyTheCodeOptIn = {
    	
        /**
         * Init
         */
        init: function()
        {
            this._bind();
        },

        _bind: function()
        {
            $( document ).on('click', '.copy-the-code-opt-in-notice-welcome .notice-dismiss', CopyTheCodeOptIn.welcome );
        },

        /**
         * Welcome
         */
        welcome: function( event ) {
            event.preventDefault();

            $.ajax({
                url: copy_the_code_opt_in.ajax_url,
                type: 'POST',
                data: {
                    action: 'copy_the_code_opt_in',
                    opt_in: 'welcome',
                    security: copy_the_code_opt_in.security,
                },
                success: function( response ) {
                    if( response.success ) {
                        $('.copy-the-code-opt-in-notice-welcome').remove();
                    }
                }
            });
        }

    };

    /**
     * Initialization
     */
    $(function() {
        CopyTheCodeOptIn.init();
    });

})(jQuery);


```
