Last active
January 9, 2022 17:53
-
-
Save KaineLabs/ac97b95c90c496ff445f24e9e859adba to your computer and use it in GitHub Desktop.
Add WP Engine Fix.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add WP Engine Fix. | |
*/ | |
function yz_fix_wpengine_scripts_fix () { | |
if ( bp_is_group() || is_page( 'activity' ) || bp_is_activity_directory() ) { | |
wp_enqueue_script( 'buddypress_query',BP_PLUGIN_URL . 'bp-core/js/jquery-query.min.js',array( 'jquery' ) ); | |
wp_enqueue_script( 'buddypress_cookie',BP_PLUGIN_URL . 'bp-core/js/vendor/jquery-cookie.min.js',array( 'jquery' ) ); | |
wp_enqueue_script( 'buddypress_js', YOUZIFY_ASSETS . 'js/buddypress.min.js',array( 'jquery' )); | |
wp_enqueue_script( 'buddypress_scrollto',BP_PLUGIN_URL . 'bp-core/js/vendor/jquery-scroll-to.min.js',array( 'jquery' ) ); | |
$params = apply_filters( 'bp_core_get_js_strings', array( | |
// Strings for display. | |
'accepted' => __( 'Accepted', 'buddypress' ), | |
'close' => __( 'Close', 'buddypress' ), | |
'comments' => __( 'comments', 'buddypress' ), | |
'leave_group_confirm' => __( 'Are you sure you want to leave this group?', 'buddypress' ), | |
'mark_as_fav' => __( 'Favorite', 'buddypress' ), | |
'my_favs' => __( 'My Favorites', 'buddypress' ), | |
'rejected' => __( 'Rejected', 'buddypress' ), | |
'remove_fav' => __( 'Remove Favorite', 'buddypress' ), | |
'show_all' => __( 'Show all', 'buddypress' ), | |
'show_all_comments' => __( 'Show all comments for this thread', 'buddypress' ), | |
'show_x_comments' => __( 'Show all comments (%d)', 'buddypress' ), | |
'unsaved_changes' => __( 'Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress' ), | |
'view' => __( 'View', 'buddypress' ), | |
// Settings. | |
'store_filter_settings' => apply_filters( 'bp_legacy_store_filter_settings', is_user_logged_in() ), | |
) ); | |
wp_localize_script( 'buddypress_js', 'BP_DTheme', $params ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'yz_fix_wpengine_scripts_fix' ); |
Is BP_PLUGIN_URL set elsewhere or do we need to change that to the url for our site???
thank you perezcarreno
torrid
kainlabs this fixxed my error now i can post everything in my website using this complete file script.
Create a file bp-custom.php in /wp-content/plugins folder
Add following script above and paste it inside bp-custom.php you just created Then at the end type
?> to close the php file hit save then refresh your browser and it will definitely work
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script is also missing the ending ?> for a php script at the bottom.