Changing the "You are not allowed to view this content" text when an entry is pending approval

If you're using GravityView to create user profiles and you have your View set to show only Approved entries, a user will see the following message if they attempt to view their profile before the entry has been approved:

The "You are not allowed to view this content" message when an entry is pending approval

You can use this filter to change the "You are not allowed to view this content" text:

add_filter( 'gettext', 'gv_modify_text', 20, 3 );
function gv_modify_text( $translated_text, $text, $domain ) {
    if ( $translated_text === "You are not allowed to view this content.") {
        $translated_text = __( "Your entry hasn't been approved yet!", 'gravityview' );
    }
    return $translated_text;
}

With the filter in place, the user will see the following message:

"Your entry hasn't been approved yet" message when accessing a profile page

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us