Skip to content

Commit 867d533

Browse files
authored
Supply fetch credential mode to front end
1 parent 6abefa1 commit 867d533

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

classes/class-cpt-wplf-form.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,10 @@ function maybe_enqueue_frontend_script() {
522522

523523
if( is_a( $post, 'WP_Post' ) && ( has_shortcode( $post->post_content, 'libre-form') || $post->post_type === 'wplf-form') ) {
524524
wp_enqueue_script( 'wplf-form-js' );
525-
wp_localize_script( 'wplf-form-js', 'ajax_object', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
525+
wp_localize_script( 'wplf-form-js', 'ajax_object', array(
526+
'ajax_url' => admin_url( 'admin-ajax.php' ),
527+
'ajax_credentials' => apply_filters('wplf_frontend_script_credentials', 'same-origin')
528+
) );
526529
}
527530
}
528531

0 commit comments

Comments
 (0)