Site icon Hip-Hop Website Design and Development

Easy methods to insert html/css/javascript code to wordpress plugin

I am making an attempt to point out a modal dialog when consumer get registered (action_hook: user_register) utilizing the woocommerce plugin, however with out having any outcome.

I might respect any assist!

The code is proven under.

myplugin.php

// handler for new_user_registered
$myplugin->register_action_hook (
    'user_register', 
    array(
        'hooksClass',
        'add_new_user'
    ));

hooks.php

public static perform add_new_user ($userid)
{
    ...
    perform enqueue_scripts() {
        wp_enqueue_script('modaljs', plugin_dir_url(__FILE__) . 'js/modal.js', array('jquery'));
        wp_enqueue_style('modalcss', plugin_dir_url(__FILE__) . 'css/modal.css');
    }
    add_action('wp_enqueue_scripts', 'enqueue_scripts');
    ?>
    <button id="myBtn">Open Modal</button>
    <div id="myModal" class="modal">
        <div class="modal-content">
            <div class="modal-header">
            <span class="shut">&occasions;</span>
            <h2>Header</h2>
            </div>
            <div class="modal-body">
              <p>Content material</p>
            </div>
            <div class="modal-footer">
            <h3>Footer</h3>
            </div>
            </div>
        </div>
    <?php
}

What I get because of this is that this picture

Thanks prematurely for any suggestion!