Skip to content

Instantly share code, notes, and snippets.

@lynt-smitka
Created March 30, 2022 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lynt-smitka/7cc2c13f97189909157d0f194a0d945a to your computer and use it in GitHub Desktop.
Save lynt-smitka/7cc2c13f97189909157d0f194a0d945a to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Managed plugins
* Description: Managed plugins detection
* Author: Vladimir Smitka
* Author URI: https://lynt.cz/
* License: GNU General Public License v3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('ABSPATH') or die('nothing here');
add_filter( 'all_plugins', 'lynt_plugin_header' );
function lynt_plugin_header( $plugins ) {
foreach ( $plugins as $key => $value ) {
if(is_link( WP_PLUGIN_DIR . '/' . explode("/",$key)[0])) {
$plugins[$key]['Name'] = '[Managed] '.$plugins[$key]['Name'];
}
}
return $plugins;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment