File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -536,6 +536,13 @@ class="libre-form libre-form-<?php echo esc_attr( $id . ' ' . $xclass ); ?>"
536536</form>
537537<?php
538538 $ output = ob_get_clean ();
539+
540+ wp_enqueue_script ( 'wplf-form-js ' );
541+ wp_localize_script ( 'wplf-form-js ' , 'ajax_object ' , array (
542+ 'ajax_url ' => admin_url ( 'admin-ajax.php ' ),
543+ 'ajax_credentials ' => apply_filters ( 'wplf_ajax_fetch_credentials_mode ' , 'same-origin ' ),
544+ ) );
545+
539546 return $ output ;
540547 }
541548
@@ -558,16 +565,6 @@ function maybe_enqueue_frontend_script() {
558565 WPLF_VERSION ,
559566 true
560567 );
561-
562- if ( is_a ( $ post , 'WP_Post ' ) ) {
563- if ( has_shortcode ( $ post ->post_content , 'libre-form ' ) || $ post ->post_type === 'wplf-form ' ) {
564- wp_enqueue_script ( 'wplf-form-js ' );
565- wp_localize_script ( 'wplf-form-js ' , 'ajax_object ' , array (
566- 'ajax_url ' => admin_url ( 'admin-ajax.php ' ),
567- 'ajax_credentials ' => apply_filters ( 'wplf_ajax_fetch_credentials_mode ' , 'same-origin ' ),
568- ) );
569- }
570- }
571568 }
572569
573570
You can’t perform that action at this time.
0 commit comments