public function installedData(string $slug, string $key): string
    {
        if (!$slug || !$key) { // Either empty?
            return ''; // Not possible.
        }
        switch ($key) {
            case 'basename':
                $key = 'Basename';
                break;
            case 'name':
                $key = 'Name';
                break;
            case 'version':
                $key = 'Version';
                break;
            case 'description':
                $key = 'Description';
                break;
            case 'url':
                $key = 'PluginURI';
                break;
            case 'text_domain':
                $key = 'TextDomain';
                break;
            case 'author':
                $key = 'Author';
                break;
            case 'author_url':
                $key = 'AuthorURI';
                break;
            default: // Default case.
                return ''; // Unknown key.
        }
        $installed_plugins = $this->s::allInstalledPlugins(); // « Cached statically.
        return !empty($installed_plugins[$slug][$key]) ? (string) $installed_plugins[$slug][$key] : '';
    }
public function installedData(string $slug, string $key): string
    {
        if (!$slug || !$key) { // Either empty?
            return ''; // Not possible.
        }
        switch ($key) {
            case 'basename':
                $key = 'Basename';
                break;
            case 'name':
                $key = 'Name';
                break;
            case 'version':
                $key = 'Version';
                break;
            case 'description':
                $key = 'Description';
                break;
            case 'url':
                $key = 'PluginURI';
                break;
            case 'text_domain':
                $key = 'TextDomain';
                break;
            case 'author':
                $key = 'Author';
                break;
            case 'author_url':
                $key = 'AuthorURI';
                break;
            default: // Default case.
                return ''; // Unknown key.
        }
        $installed_plugins = $this->s::allInstalledPlugins(); // « Cached statically.
        return !empty($installed_plugins[$slug][$key]) ? (string) $installed_plugins[$slug][$key] : '';
    }
public function installedData ( string $ slug , string $ key ) : string { if ( ! $ slug || ! $ key ) { // Either empty? return '' ; // Not possible. } switch ( $ key ) { case 'basename' : $ key = 'Basename' ; break ; case 'name' : $ key = 'Name' ; break ; case 'version' : $ key = 'Version' ; break ; case 'description' : $ key = 'Description' ; break ; case 'url' : $ key = 'PluginURI' ; break ; case 'text_domain' : $ key = 'TextDomain' ; break ; case 'author' : $ key = 'Author' ; break ; case 'author_url' : $ key = 'AuthorURI' ; break ; default : // Default case. return '' ; // Unknown key. } $ installed_plugins = $ this -> s :: allInstalledPlugins ( ) ; // « Cached statically. return ! empty ( $ installed_plugins [ $ slug ] [ $ key ] ) ? ( string ) $ installed_plugins [ $ slug ] [ $ key ] : '' ; }
Installed plugin data from slug.

@since 160524 First documented version.

@param string $slug Plugin slug.
@param string $key  Data key to acquire.

@return string Plugin data key; always a string.
Installed plugin data from slug .