Fixing a bug in BuddyPress – buddypress jq.cookie( ‘bp-activity-oldestpage
Recently after an update, BuddyPress encountered an issue that caused all scripts to (javascript) stopped working, got into the console and saw an error in the file global.js. In fact, as it turned out later, the error was not in this file., and in the very core of the plugin, developers forgot to enter one line:
wp_enqueue_script( $id );
My error looked like this:
buddypress jq.cookie( ‘bp-activity-oldestpage …….
How to fix bp-activity-oldestpage... error
To fix the error, go to /wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php and find the line 34 which contains the following code:
1 2 3 4 |
$version = bp_get_version(); foreach ( $scripts as $id => $script ) { wp_register_script( $id, $script['file'], $script['dependencies'], $version ); } |
One more line needs to be added to this code, which will include plugin scripts:
1 2 3 4 5 |
$version = bp_get_version(); foreach ( $scripts as $id => $script ) { wp_register_script( $id, $script['file'], $script['dependencies'], $version ); wp_enqueue_script( $id ); } |
Just one line wp_enqueue_script( $id ) fixed the bug and it worked. Thanks to the budyPress community for the good advice.
Here you can see commit this issue.
p. with. I know that it's not very good to climb into the core of the plugin, but let's hope that with the next update this bug will be fixed. If you have any ideas how to fix the bug so that everything goes smoothly when updating, write and I will finalize the article.
/*
- Basic web design course;
- Site layout;
- General course on CMS WordPress and continuation of the course on template development;
- Website development in PHP.