Skip to content

Commit 7027662

Browse files
authored
Merge pull request #46 from k1sul1/patch-1
add filter for frontend dependencies
2 parents 2e6dba8 + 4a554c1 commit 7027662

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

classes/class-cpt-wplf-form.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,13 @@ function maybe_enqueue_frontend_script() {
512512
global $post;
513513

514514
// register the script, but only enqueue it if the current post contains a form in it
515-
wp_register_script( 'wplf-form-js', plugins_url( 'assets/scripts/wplf-form.js', dirname(__FILE__) ), array(), WPLF_VERSION, true );
515+
wp_register_script(
516+
'wplf-form-js',
517+
plugins_url( 'assets/scripts/wplf-form.js', dirname(__FILE__) ),
518+
apply_filters( 'wplf_frontend_script_dependencies', array() ),
519+
WPLF_VERSION,
520+
true
521+
);
516522

517523
if( is_a( $post, 'WP_Post' ) && ( has_shortcode( $post->post_content, 'libre-form') || $post->post_type === 'wplf-form') ) {
518524
wp_enqueue_script( 'wplf-form-js' );

0 commit comments

Comments
 (0)