Strict Standards: Non-static method in sidebar generator

There’s not a huge amount you can do about this. Many developers turn off strict errors, as they are pervasive (there are even some in core). Of course it could be fixed – but then what? It’s a plugin, so the next time you update that plugin, your changes will be overwritten.

Method not receiving attributes from shortcode call, general OOP problems

First, you have to initiate the class, something like: add_action( ‘init’, function() { $CsvImporter = new CsvImporter; } ); Also, you are using extract() wrong; extract() won’t build $attributes as an array. Anyway, extract() is not recommended any more and you should avoid using it. Also, note taht if ($attributes[‘mods’]) should be if ($attributes[‘type’] == … Read more

Using add action for class with construct

above code does not works for me, is not correct or any mistake from my side? And it didn’t work for me either. Because it throws this fatal error: PHP Fatal error: No code may exist outside of namespace {} in … And that’s because the PHP manual says: No PHP code may exist outside … Read more

How To Remove The Filter That Adds JetPack Related Content To Dom [closed]

$jprp = Jetpack_RelatedPosts::init(); remove_filter( ‘the_content’, array( $jprp, ‘filter_add_target_to_dom’ ) ); Should work fine. The Jetpack_RelatedPosts init function implements the singleton pattern, so calling it will return the already instantiated instance, which you can use to remove the filter. Just make sure you call your code late enough. The main module is hooking the add_action to … Read more