So I have a made a small manager plugin myself to modify some core elements from WordPress and I also hide it from my clients so they can't disable it as it also hides WPManage which is the management tool I use to control most of the websites I manage.
I've looked through the WordPress Codex and found the following:
Which then provided me with the following code:
function auto_update_specific_plugins ($update, $item){
$plugins = array('worker');
if (in_array($item->slug, $plugins)){return true;}else{return $update;}
}
add_filter('auto_update_plugin','auto_update_specific_plugins',10,2);
I added this however into my own manager plugin lets call it SHS Manager, which is also hidden, but of course WP Manager does gets updates but as I've hidden it from within the SHS Manager plugin (which is also hidden so it can't be disabled easily) I therefore can't easily update it and am therefor looking for a way to automatically update WP Manager Worker plugin when there's an update available.
While I thought the above code worked which I did put in my SHS Manager tool, it for some reason never actually updated to WP Manager Worker Plugin at all, what am I missing here?
I made sure that the slug is the correct one being that the plugin is called 'worker' and that obviously the plugin was out of date to see if it would auto update, couple refreshes later and a period of time but it was still on the old version.
Am I missing something, are some crons required or are set in place that it only does this check once an hour or something or what am I exactly missing here that would cause this piece of code that is put in the WordPress Codex to not function correctly?
I've already searched through a lot of stack overflow similar questions but most were outdated or provided the same code that could be found on the WordPress Codex.
So any suggestions are welcomed.
Thanks in advance.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745493573a4630094.html
评论列表(0条)