Как переместить встроенный jQuery скрипт Ajax Gravity Form в нижний колонтитул? - PullRequest
0 голосов
/ 02 апреля 2020

Для добавления отсрочки к ссылке jquery я хотел бы переместить встроенный jQuery скрипт Ajax Gravity Form в нижний колонтитул.

Как я могу это сделать?

enter image description here

1 Ответ

0 голосов
/ 02 апреля 2020

Это может работать:

/**
 * Force GFORM Scripts inline next to Form Output
 *
 * force the script tags inline next to the form. This allows
 * us to regex them out each time the form is rendered.
 * 
 * see strip_inline_gform_scripts() function below
 * which implements the required regex
 */
add_filter("gform_init_scripts_footer", "__return_false");

/**
 * Strip out GForm Script tags
 *
 * note: this diables post and pre render hooks which are triggered
 * when the form renders so if you need these then it's important
 * to manually re-add them in your compiled JS source code
 */

add_filter("gform_get_form_filter", function( $form_string, $form ) {
  return $form_string = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $form_string);
}, 10, 2);
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...