Why is one phpunit test throwing an error on one class when all other classes are similar without error?

the async property is marked as protected, so that usually signifies that it is related more to your implementation’s details rather than functionality. Ideally you would write your tests to test the public methods you have exposed. Testing that the class property you set in the constructor of one class is an instanceof what was … Read more

Use $_GET inside a shortcode print empty Array

$_GET is a glob var. which is triger/created when you’re sending html form data og visit a link. When is send from form you can add the needet info in “action” atr. But from youre example i see onlu that you return from the function some string…did not see the part of adding it to … Read more

Is there a best practice remediation for PhpStorm’s warning that void function the_post_thumbnail is used?

The solution is simple, don’t echo the result of that function, there is no result to echo. echo the_post_thumbnail(array(155,55)); Is equivalent to something like this: echo ”; the_post_thumbnail(array(155,55)); Functions that begin with the_ in WP don’t return things, they output things. Some of them let you pass a parameter that lets them return instead, but … Read more

Would Gutenberg be considered a PlugIn?

It’s slightly complicated. The default editor in WordPress is what’s properly called the “block editor”, but while this editor was being developed it was known as the “Gutenberg” project. The development on Gutenberg was done in the form of a plugin, which people could install for the purposes of testing and contributing. When WordPress 5.0 … Read more

How to tell which one of my plugins are paid or free?

Usually premium plugins that came with the purchase of a theme are updated via an external updater, not the wordpress built-in one. That could be one of the clues. One obvious clue would be that the plugin has some kind of login/licence key system. But when it comes to taking a look in the code, … Read more

Save values from a pre_post_update

The second attempt is closer to the result, as it is filer, not action, and you can return proper data. But code has several mistakes, I have fixed them. The proper number of parameters for the filter is 3. The first parameter is $data which should be modified and returned. It is the standard behaviour … Read more

How do I find out what is in control over a certain part of a website?

However WordPress does it, it can’t peer inside BuddyBoss if BuddyBoss decides to implement its own system ( and almost all the pagebuilder plugins or bespoke systems do ). Fundamentally responsibility on the frontend falls into these buckets: the theme filters blocks/shortcodes/widgets nav menus plugins generated UIs such as ACF field layouts, WP Bakery, Elementor, … Read more

Can someone explain me why apply_filters() is called here?

It’s not doing anything on its own – the original author is offering you the ability to change these hard-coded actions without needing to edit the source code itself. Imagine you just edited the array right there. Then a plugin update comes along, the file is overwritten, and your custom changes are lost. Using a … Read more