Won't fixJS load error

This topic contains 1 reply, has 2 voices, and was last updated by  MillaN 4 months ago.

  • Creator
    Topic
  • #55963

    brivals
    Participant

    I encountered a situation with ” GD bbpress attachment “.
    I realized that since the update of wordpress, the script gd-bbpress-attachment.js was not correctly loaded.

    I share with you my solution!

    In the file /wp-content/plugins/gd-bbpress-attachments/code/attachments/front.php I modified the function:

    public function wp_enqueue_scripts() {
    if (d4p_bba_o(‘include_always’) == 1 || d4p_is_bbpress()) {
    if (d4p_bba_o(‘include_css’) == 1) {
    wp_enqueue_style(‘d4p-bbattachments-css’, GDBBPRESSATTACHMENTS_URL.’css/gd-bbpress-attachments.css’, array(), GDBBPRESSATTACHMENTS_VERSION);
    }

    if (d4p_bba_o(‘include_js’) == 1) {
    wp_enqueue_script(‘jquery’);
    wp_register_script(‘d4p-bbattachments-js’, GDBBPRESSATTACHMENTS_URL.’js/gd-bbpress-attachments.js’, array(‘jquery’), GDBBPRESSATTACHMENTS_VERSION);
    wp_enqueue_script(‘d4p-bbattachments-js’);
    }
    }
    }

    Furthermore, when I clicked the button “Add another file”, it created a “page jump”.
    To correct, I modify the file /wp-content/plugins/gd-bbpress-attachments/forms/uploader.php :
    <?php _e(“Add another file”, “gd-bbpress-attachments”); ?>

    Topic Information
    Bug Report
    5.3
    4.7
    2.4
Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #55964

    MillaN
    Keymaster

    This is wrong solution. You have the problem because of the way you integrate bbPress on your website, and my plugin can’t correctly detect the page as a bbPress page. For that case, there is an option in the plugin settings to force loading of JS and CSS always, and no need to hack the plugin. Enable that option and it will work OK.

    Dev4Press - Premium plugins for WordPress.

Viewing 1 replies (of 1 total)

The topic ‘JS load error’ is closed to new replies.