How to get parameters with add_filter with a static method?

First, consult the documentation or source code to see how many arguments are passed to the filter. We can see it has 3 in total, and the comments object is the second one, so you’ll need to have at least two. Next, you’ll want to declare the number of arguments to pass to the function … Read more

How to wait for WordPress Core to load when writing OOP?

The core problem is that you are not writing OOP. OOP is about identifying objects in your system, not actions. If you want to identify actions than you are better to follow functional design paradigms (and with wordpress hook system, functional design make much more sense). In your case redirect is an action, that probably … Read more

Using Geo Data Store Plugin Code

I deleted the Geo Data Store plugin and reinstalled, in which my code worked upon refresh. I was able to use the functions from the plugin and so on. I casted as an array so as to use the output in my wp_query arguments $sc_gds = new sc_GeoDataStore(); $ids = (array) $sc_gds->getPostIDsOfInRange( $type, $radius, $lat, … Read more

Admin submenu does not call function to load the page

I found my solution. Problem of hrefs when the wordpress core did not find the function callback or it’s empty for the functions add_menu_page() and add_submenu_page() the href wil be generated like this : http(s)://my-site.org/wp-admin/my-slug-page, otherwise the href is in this format : http(s)://my-site.org/wp-admin/admin.php?page=my-slug-page So In my case, I had to be sure the functions … Read more

How pass args to wp_list_comments callback?

After looking at the wp_list_comments() and Walker_Comment sources I would assume the callback is what the Walker uses to render single comments. And the callback recieves three parameters $comment, $args, $depth when the Walker calls it. Based on this, I assume you should be able to just push custom key-value pairs to your $args array … Read more