Puedes probar esto:
is_admin() && add_filter( 'gettext',
function( $translated_text, $untranslated_text, $domain )
{
$old = array(
"Plugin <strong>activated</strong>.",
"Selected plugins <strong>activated</strong>."
);
$new = "Captain: The Core is stable and the Plugin is <strong>activated</strong> at full Warp speed";
if ( in_array( $untranslated_text, $old, true ) )
$translated_text = $new;
return $translated_text;
}
, 99, 3 );
para modificar el mensaje a su gusto:

Podemosrefinarlomás:
Sisoloquieresactivarelfiltroenlapágina/wp-admins/plugins.php
,puedesusarlosiguiente:
add_action('load-plugins.php',function(){add_filter('gettext','b2e_gettext',99,3);});
con:
/***Translatethe"Plugin activated." string
*/
function b2e_gettext( $translated_text, $untranslated_text, $domain )
{
$old = array(
"Plugin <strong>activated</strong>.",
"Selected plugins <strong>activated</strong>."
);
$new = "Captain: The Core is stable and the Plugin is <strong>activated</strong> at full Warp speed";
if ( in_array( $untranslated_text, $old, true ) )
{
$translated_text = $new;
remove_filter( current_filter(), __FUNCTION__, 99 );
}
return $translated_text;
}
donde eliminamos la devolución de llamada del filtro gettext tan pronto tengamos una coincidencia.
Si queremos verificar la cantidad de llamadas de Gettext realizadas antes de que coincidamos con la cadena correcta, podemos usar esto:
/**
* Debug gettext filter callback with counter
*/
function b2e_gettext_debug( $translated_text, $untranslated_text, $domain )
{
static $counter = 0;
$counter++;
$old = "Plugin <strong>activated</strong>.";
$new = "Captain: The Core is stable and the Plugin is <strong>activated</strong> at full Warp speed";
if ( $untranslated_text === $old )
{
$translated_text = $new;
printf( 'counter: %d - ', $counter );
remove_filter( current_filter(), __FUNCTION__ , 99 );
}
return $translated_text;
}
y recibo 301
llamadas en mi instalación:

Puedoreducirloasolo10
calls:
agregando el filtro gettext dentro del enlace in_admin_header
, dentro del enlace load-plugins.php
:
add_action( 'load-plugins.php',
function(){
add_action( 'in_admin_header',
function(){
add_filter( 'gettext', 'b2e_gettext_debug', 99, 3 );
}
);
}
);
Tenga en cuenta que esto no contará las llamadas gettext antes de la redirección interna utilizada cuando se activan los complementos.
Para activar nuestro filtro después de la redirección interna, podemos verificar los parámetros GET utilizados cuando se activan los complementos:
/**
* Check if the GET parameters "activate" and "activate-multi" are set
*/
function b2e_is_activated()
{
$return = FALSE;
$activate = filter_input( INPUT_GET, 'activate', FILTER_SANITIZE_STRING );
$activate_multi = filter_input( INPUT_GET, 'activate-multi', FILTER_SANITIZE_STRING );
if( ! empty( $activate ) || ! empty( $activate_multi ) )
$return = TRUE;
return $return;
}
y usar así:
b2e_is_activated() && add_filter( 'gettext', 'b2e_gettext', 99, 3 );
en el ejemplo de código anterior.