Subscribe Plugins
apply_filters( 'vikupdater_subscribe_plugins', array $plugins )
Filter used to obtain a list of plugins that wishes to use the features provided by VikUpdater.
Description
Plugins interested in subscribing themselves can attach the following information to the return array.
Except for slug
, plugin
, version
and url
; all the other parameters can be specified by the JSON object returned by the "check" url.
name
-
(string) The name of the plugin, such as "Your Plugin" (mandatory).
slug
-
(string) The slug of the plugin, such as "your-plugin" (mandatory).
plugin
-
(string) The plugin identifier, such as "your-plugin/yourplugin.php" (mandatory).
author
-
(string) The author that developed the plugin (optional). If not provided, the system will assume that the manufacturer is "E4J srl".
author_profile
-
(string) The link of the plugin author (optional). If not provided, the system will assume that the author URL is "https://vikwp.com".
version
-
(string) The currently installed version of the plugin (mandatory).
tested
-
(string) The WordPress tested-up-to version (optional).
requires
-
(string) The minimum required version of WordPress (optional).
requires_php
-
(string) The minimum required version of PHP (optional).
url
-
(string) The URL needed to check the latest version of the plugin (mandatory). Must return a JSON object, which supports all the properties specified here.
download
-
(string) The URL needed to download the latest version of the plugin (mandatory).
last_updated
-
(string) The last updated date in military format (optional).
contributors
-
(array) An associative array containing the plugin contributors (optional). If provided, the array must contain an associative array specifying the "avatar", "profile" and "display_name" attributes. If not provided, the system will take the default "VikWP" contributors.
description
-
(string) The main HTML description of the plugin (optional, but recommended).
installation
-
(string) The HTML content to be displayed under the "Installation" tab (optional).
faq
-
(string) The HTML content to be displayed under the "FAQ" tab (optional).
notes
-
(string) The HTML content to be displayed under the "Notes" tab (optional).
changelog
-
(array|string) An HTML string containing the changelog (optional).
banners
-
(array) The plugin banners array (optional). If provided, the array must define both the "low" and "high" (resolution) attributes.
screenshots
-
(array) An array of screenshots (optional). If you want to specify a caption, the list must contain associative arrays defining both the "src" and "caption" attributes.
Parameters
- $plugins
-
(array) A list of subscribers. Each element of the array should be an associative array specifying the information previously described.
Example
The example below explains how to subscribe a custom plugin to VikUpdater.
function your_plugin_vikupdater_subscribe( $subscribers ) {
$subscribers[] = [
// replace with the real name of your plugin
'name' => 'Your Plugin Name',
// replace with the slug of your plugin (required)
'slug' => 'your-plugin',
// replace with the id of your plugin, which is usually built
// as "folder/file.php" (required)
'plugin' => 'your-plugin/yourplugin.php',
// replace with the current version of your plugin (required)
'version' => '1.0',
// the minimum required version of WordPress (optional)
'requires' => '4.0',
// the minimum required version of your PHP (optional)
'requires_php' => '7.4',
// the description of your product (optional)
'description' => __('Your plugin description.', 'your-plugin'),
// the URL used to fetch the manifest of your plugin (required)
'url' => 'https://your-plugin-url.com/api/version',
// the URL used to download the latest version of the plugin
'download' => 'https://your-plugin-url.com/api/latest',
];
return $subscribers;
}
add_filter( 'vikupdater_subscribe_plugins', 'your_plugin_vikupdater_subscribe' );
Changelog
Version | Description |
---|---|
2.0 | Introduced. |