PHP code example of afragen / add-plugin-dependency-api

1. Go to this page and download the library: Download afragen/add-plugin-dependency-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

afragen / add-plugin-dependency-api example snippets


// Add the sites with REST enpoints that return plugins_api() data when passed `slug` query arg.
// You can also return URL to a JSON file containing the appropriate data.
add_filter(
	'plugin_dependency_endpoints',
	function () {
		return [ 'https://git-updater.com/wp-json/git-updater/v1/plugins-api/' ];
	}
);