Why can wordpress not find the actions I add in my constructor?

Your constructor runs on the request from which you make the AJAX request, but not within the request that processes that AJAX request. The request that initially loads the page, and the AJAX request are two separate requests with no preservation of state between the two. This is not unique to WordPress, this is how … Read more

private functions in plugins

Well, it is not possible, I guess. If you define function in global scope, then it is visible for all code. The only way to make it private for plugin is to use OOP (and it’s recommended way of writing plugins). You can rename this function, but it won’t solve your problem in the long … 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

How to remove a filter that is an anonymous object?

That’s a very good question. It goes down to the dark heart of the plugin API and best programming practices. For the following answer I created a simple plugin to illustrate the problem with easy to read code. <?php # -*- coding: utf-8 -*- /* Plugin Name: Anonymous OOP Action */ if ( ! class_exists( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)