I have this JS function named as “myjsfunction()”.
function myjsfunction() {
jQuery('#html_admin_show').hide();
jQuery('#html_admin_edit').show();
}
How is it possible to call this JS function inside a WordPress do_action hook?
I’m preferring to add it as third parameter because I’m already using the second parameter, so something like:
do_action('myhelp', 'mysecondfunction', 'myjsfunction');
But it is not showing the element #html_admin_edit when the page runs. Any ideas how to call this function?
Thank you for any tips.
I have my answers here: https://wordpress.stackexchange.com/questions/79969/adding-js-function-as-third-parameter-in-do-action/79970#79970
The trick is to enclose the Javascript function within PHP and call them one by one using do_action. Hope this helps.