Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/wp-rocket/inc/3rd-party/plugins/buddypress.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 +
3 + defined( 'ABSPATH' ) || exit;
4 +
5 + if ( class_exists( 'BuddyPress' ) ) :
6 + /**
7 + * Conflict with BuddyPress: don't apply LazyLoad on BuddyPress profil pages & group creation
8 + *
9 + * @since 2.8.15 Improve checks for user profile & disable for cover images
10 + * @since 2.6.9
11 + */
12 + if ( function_exists( 'bp_is_user_profile' ) ) :
13 + /**
14 + * Prevent lazyload if on a BuddyPress profil page
15 + *
16 + * @param Bool $run_filter Do lazyload value.
17 + * @return Bool False if on a BuddyPress profil page, initial value otherwise
18 + */
19 + function rocket_deactivate_lazyload_on_buddypress_profil_pages( $run_filter ) {
20 + if ( bp_is_user_profile() ) {
21 + return false;
22 + }
23 +
24 + return $run_filter;
25 + }
26 + add_filter( 'do_rocket_lazyload', 'rocket_deactivate_lazyload_on_buddypress_profil_pages' );
27 + add_filter( 'do_rocket_lazyload_iframes', 'rocket_deactivate_lazyload_on_buddypress_profil_pages' );
28 + endif;
29 +
30 + if ( function_exists( 'bp_is_group_creation_step' ) && function_exists( 'bp_is_group_admin_screen' ) ) :
31 + /**
32 + * Prevent lazyload if on a BuddyPress group creation page
33 + *
34 + * @param Bool $run_filter Do lazyload value.
35 + * @return Bool False if on a BuddyPress profil page, initial value otherwise
36 + */
37 + function rocket_deactivate_lazyload_on_buddypress_group_pages( $run_filter ) {
38 + if ( bp_is_group_creation_step( 'group-avatar' ) || bp_is_group_creation_step( 'group-cover-image' ) || bp_is_group_admin_screen( 'group-avatar' ) || bp_is_group_admin_screen( 'group-cover-image' ) ) {
39 + return false;
40 + }
41 +
42 + return $run_filter;
43 + }
44 + add_filter( 'do_rocket_lazyload', 'rocket_deactivate_lazyload_on_buddypress_group_pages' );
45 + add_filter( 'do_rocket_lazyload_iframes', 'rocket_deactivate_lazyload_on_buddypress_group_pages' );
46 + endif;
47 + endif;
48 +