Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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