1

enter image description here

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

1

1 Answer 1

1

A 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.org/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.

1
  • Hello Thanks for sharing... I want to change in post list Nov 18, 2019 at 5:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.