admin管理员组文章数量:1427327
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.
本文标签: Auto Update A WordPress Plugin from within another WordPress Manager Plugin
版权声明:本文标题:Auto Update A WordPress Plugin from within another WordPress Manager Plugin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745493572a2660710.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论