File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -541,6 +541,13 @@ class="libre-form libre-form-<?php echo esc_attr( $id . ' ' . $xclass ); ?>"
541541</form>
542542<?php
543543 $ output = ob_get_clean ();
544+
545+ wp_enqueue_script ( 'wplf-form-js ' );
546+ wp_localize_script ( 'wplf-form-js ' , 'ajax_object ' , array (
547+ 'ajax_url ' => admin_url ( 'admin-ajax.php ' ),
548+ 'ajax_credentials ' => apply_filters ( 'wplf_ajax_fetch_credentials_mode ' , 'same-origin ' ),
549+ ) );
550+
544551 return $ output ;
545552 }
546553
@@ -563,16 +570,6 @@ function maybe_enqueue_frontend_script() {
563570 WPLF_VERSION ,
564571 true
565572 );
566-
567- if ( is_a ( $ post , 'WP_Post ' ) ) {
568- if ( has_shortcode ( $ post ->post_content , 'libre-form ' ) || $ post ->post_type === 'wplf-form ' ) {
569- wp_enqueue_script ( 'wplf-form-js ' );
570- wp_localize_script ( 'wplf-form-js ' , 'ajax_object ' , array (
571- 'ajax_url ' => admin_url ( 'admin-ajax.php ' ),
572- 'ajax_credentials ' => apply_filters ( 'wplf_ajax_fetch_credentials_mode ' , 'same-origin ' ),
573- ) );
574- }
575- }
576573 }
577574
578575
You can’t perform that action at this time.
0 commit comments