wpcf7_recaptcha_enqueue_scripts() CF7 1.0
Хуки из функции
Возвращает
Null. Ничего.
Использование
wpcf7_recaptcha_enqueue_scripts();
Код wpcf7_recaptcha_enqueue_scripts() wpcf7 recaptcha enqueue scripts CF7 5.3.2
function wpcf7_recaptcha_enqueue_scripts() {
$service = WPCF7_RECAPTCHA::get_instance();
if ( ! $service->is_active() ) {
return;
}
wp_enqueue_script( 'google-recaptcha',
add_query_arg(
array(
'render' => $service->get_sitekey(),
),
'https://www.google.com/recaptcha/api.js'
),
array(),
'3.0',
true
);
wp_enqueue_script( 'wpcf7-recaptcha',
wpcf7_plugin_url( 'modules/recaptcha/script.js' ),
array( 'google-recaptcha' ),
WPCF7_VERSION,
true
);
wp_localize_script( 'wpcf7-recaptcha',
'wpcf7_recaptcha',
array(
'sitekey' => $service->get_sitekey(),
'actions' => apply_filters( 'wpcf7_recaptcha_actions', array(
'homepage' => 'homepage',
'contactform' => 'contactform',
) ),
)
);
}