Above Screenshot of admin side post listing page showing count like All, Published and Pending. I want to change the text "Published" to "Approved".
Please help me. Thanks in Advance
Above Screenshot of admin side post listing page showing count like All, Published and Pending. I want to change the text "Published" to "Approved".
Please help me. Thanks in Advance
Share Improve this question edited Nov 15, 2019 at 21:11 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Nov 15, 2019 at 12:17 nikhil Hadvaninikhil Hadvani 686 bronze badges 1- try this filter : developer.wordpress/reference/hooks/views_this-screen-id – Kaperto Commented Nov 15, 2019 at 12:34
1 Answer
Reset to default 1A simple change would run via javascript, but run lately and in dependence that Javascript is active on the user side. The WordPress way is to use filters to change this text. However, this is a topic in context performance and should look in this direction.
This is the typical code snippet to change text.
add_filter( 'gettext', 'prefix_change_comment_field_names', 20, 3 );
/**
* Change comment form default field names.
*
* @link https://codex.wordpress/Plugin_API/Filter_Reference/gettext
*/
function prefix_change_comment_field_names( $translated_text, $text, $domain ) {
if ( ! is_admin() ) {
return $translated_text;
}
switch ( $translated_text ) {
case 'Published' :
$translated_text = esc_html__( 'Approved', 'theme_text_domain' );
break;
case 'Email' :
$translated_text = esc_html__( 'Email Address', 'theme_text_domain' );
break;
}
return $translated_text;
}
See these posts for more information and longer hints, especially for only change on specific admin pages.
- https://wordpress.stackexchange/a/174588/170
- Changing the "Plugin Activated" Message Default