Envira Gallery Documentation

Documentation, Reference Materials and Tutorials for Envira Gallery

Whitelabel Envira

Share This Post!

Whitelabeling Envira is very easy. Simply drop this code into your theme’s functions.php file to change all instances of “Envira Gallery” to simply say “Gallery” and remove the Envira banner.

add_filter( 'gettext', 'tgm_envira_whitelabel', 10, 3 );
function tgm_envira_whitelabel( $translated_text, $source_text, $domain ) {
    
    // If not in the admin, return the default string.
    if ( ! is_admin() ) {
        return $translated_text;
    }

    if ( strpos( $source_text, 'an Envira' ) !== false ) {
        return str_replace( 'an Envira', '', $translated_text );
    }
    
    if ( strpos( $source_text, 'Envira' ) !== false ) {
        return str_replace( 'Envira', '', $translated_text );
    }
    
    return $translated_text;
    
}

add_action( 'admin_init', 'tgm_envira_remove_header' );
function tgm_envira_remove_header() {
    
    // Remove the Envira banner
    remove_action( 'in_admin_header', array( Envira_Gallery_Posttype_Admin::get_instance(), 'admin_header' ), 100 );

}
Share This Post!