Daniel Bachmann

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
in reply to: [wpdm_tree] not working #86522

It seems the answer I posted yesterday got lost…

So in short:

Copy jqueryFileTree.js from” /wp-content/plugins/download-manager/js” to a folder “js” in your theme.

Add the following code to the themes function.php

add_action(‘wp_enqueue_scripts’, ‘dbwp_fix_wpdm_enqueue’, 200);
function dbwp_fix_wpdm_enqueue(){
if(!wp_script_is( ‘file-tree-js’)){
wp_enqueue_script(
‘file-tree-js’, get_stylesheet_directory_uri().”/js/jqueryFileTree.js”,
null,
null,
true
);
}
}

This fixed the error I had and should work if you have the same error (something like “.filetree is not a function in the browser console).

However @Dmkjr this doesn’t seem to be your problem, as the shortcode isn’t even executed.

I can naturally just take a guess, but from similar problems:

  • Is the WPDM plugin activated? (yeah, sometimes its just something like that…)
  • Are you using a caching plugin? Try deleting/purging the cache
in reply to: [wpdm_tree] not working #86500

This is a javascript error, because “jqueryFileTree.js” is not loaded at the frontend.
(It is, however on “admin_enqueue_scripts”, to be precise)

For now I added:

if(!wp_script_is( ‘file-tree-js’)){
wp_enqueue_script(‘file-tree-js’, get_stylesheet_directory_uri().”/js/jqueryFileTree.js”,
array(‘dbwp_jquery’),
null, true);
}

to an extra functions.php enqueue function (this shouldn’t be a security issue, as it just serves the jquery-file-tree functionality).

Gave it a quite late priority on add_action (200) so WPDM should have enqueued if it does, so I hope this doesn’t break, when wpdm is updated.

Viewing 2 posts - 1 through 2 (of 2 total)