我试图在用户使用woocommerce插件注册(action\\u hook:user\\u register)时显示一个模式对话框,但没有任何结果。
如果有任何帮助,我将不胜感激!
代码如下所示。
myplugin.php
// handler for new_user_registered
$myplugin->register_action_hook (
\'user_register\',
array(
\'hooksClass\',
\'add_new_user\'
));
hooks.php
public static function add_new_user ($userid)
{
...
function 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="close">×</span>
<h2>Header</h2>
</div>
<div class="modal-body">
<p>Content</p>
</div>
<div class="modal-footer">
<h3>Footer</h3>
</div>
</div>
</div>
<?php
}
What I am getting as a result is this image提前感谢您的建议!