What are the details for function argument wp_update_plugin()

The first argument is the plug-in’s ‘slug’. The plug-in slug is determined by the location of the .php file header containing the comment header necessary for plug-ins. (see source).

If your main plug-in file might be ~/wp-content/plugins/foo/bar.php, while your plug-in slug is foo/bar.php.

If the wp-content dir has a custom name, you can retrieve it using content_url( $path ), where $path is any trailingslashed single suffix like the plugins directory. Keep in mind that at the end of the function there is a filter, so you better check if something modified it. Then there’s plugins_url( $path, $plugin ) and so on. So you better make sure you got the right path that takes the different possible locations into account.

The second argument is a callback which will be hooked onto update_feedback filter. This only appears to be used in update-core.php (source)). I believe this can be used to force flush the output so the user gets some kind of feedback – but I’m not sure where (or if) core does this.

Leave a Comment