Closed cabrerahector closed 2 years ago
Hi @cabrerahector,
Could you also provide a way to use remove_action()
with your inline_loading_css
action in WordPressPopularPosts\Front\Front
class ?
I want to remove this inline css code and use my own css from theme.
Currently we have no possibility to achieve this :
inline_loading_css()
is not staticThanks :)
Yup, I can look into that as well. I'll leave a comment here when/if a find a simple way to do that @lflorent :)
Hi @cabrerahector,
The simplest way I think is to change :
public function inline_loading_css()
to public static function inline_loading_css()
add_action('wp_head', [$this, 'inline_loading_css']);
to add_action('wp_head', ['WordPressPopularPosts\Front\Front', 'inline_loading_css']);
I tested and it works when I use remove_action('wp_head', array('WordPressPopularPosts\Front\Front', 'inline_loading_css'), 10);
on my function.php
;)
@lflorent FYI thanks for the suggestion, however I decided to go for a different solution instead:
add_filter('wpp_insert_loading_animation_styles', '__return_false');
The end result will still be the same :)
@cabrerahector thanks for the new filter ;)
At the moment the plugin injects this inline
style
tag to the<head>
section of the page so ajaxified widgets can display their loading animation bar.We could improve things a bit:
id
parameter to the tag for easier identification and so it can be manipulated (this is an user request, see Inlined style in HTML).