Skip to main content
added 100 characters in body
Source Link
Emerson Maningo
  • 619
  • 2
  • 12
  • 29

I have this JS function named as "myjsfunction()".

function myjsfunction() {

jQuery('#html_admin_show').hide();
jQuery('#html_admin_edit').show();

}

One limitation is that I cannot edit the original JS function like to put some PHP tags, etc.

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?

Thanks.

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?

Thanks.

I have this JS function named as "myjsfunction()".

function myjsfunction() {

jQuery('#html_admin_show').hide();
jQuery('#html_admin_edit').show();

}

One limitation is that I cannot edit the original JS function like to put some PHP tags, etc.

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?

Thanks.

Source Link
Emerson Maningo
  • 619
  • 2
  • 12
  • 29

Adding JS function as third parameter in do_action

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?

Thanks.