Skip to content

Commit

Permalink
📦 NEW: Remove clutter from CleanTalk plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
austinginder committed Oct 22, 2024
1 parent 79170c0 commit fc4cc91
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion lib/remote-scripts/deploy-helper
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ read -r -d '' build_mu_plugin << 'heredoc'
* Plugin Name: CaptainCore Helper
* Plugin URI: https://captaincore.io
* Description: Collection of helper functions for CaptainCore
* Version: 0.2.6
* Version: 0.2.7
* Author: CaptainCore
* Author URI: https://captaincore.io
* Text Domain: captaincore-helper
Expand Down Expand Up @@ -191,6 +191,36 @@ add_filter( 'auto_plugin_update_send_email', '__return_false' );
*/
add_filter( 'auto_theme_update_send_email', '__return_false' );
/**
* Remove clutter from CleanTalk plugin.
*/
add_action('after_setup_theme', function() {
remove_filter('plugin_row_meta', 'apbct_admin__register_plugin_links', 10);
});
add_filter('all_plugins', function($plugins) {
$plugin_file = 'cleantalk-spam-protect/cleantalk.php';
// Check if the plugin exists in the list and modify the name
if (isset($plugins[$plugin_file])) {
$plugins[$plugin_file]['Name'] = 'CleanTalk Anti-Spam';
}
return $plugins;
});
add_filter('plugin_row_meta', function($plugin_meta, $plugin_file) {
$target_plugin = 'cleantalk-spam-protect/cleantalk.php';
// Check if the plugin matches the one you want to modify
if ($plugin_file === $target_plugin) {
// Find the "By" field and replace it
foreach ($plugin_meta as &$meta) {
if (strpos($meta, 'СleanTalk - Anti-Spam Protection') !== false) {
$meta = str_replace('СleanTalk - Anti-Spam Protection', 'CleanTalk', $meta);
}
}
}
return $plugin_meta;
}, 10, 2);
/**
* The following uses IP ranges provided by the IP2Location LITE database
* See here: https://lite.ip2location.com
Expand Down

0 comments on commit fc4cc91

Please sign in to comment.