Envira Gallery Documentation

Documentation, Reference Materials and Tutorials for Envira Gallery

Whitelabel Envira

Share This Post!

Do you want to remove the Envira branding from your Envira Gallery? You can whitelabel Envira very easily! 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 and branding.

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_filter( 'envira_whitelabel', '__return_true' );

The following is for more advanced users and requires a more extensive knowledge of coding principles. For more complete control, you can use the following filters and actions. We’ve provided a few examples of how to use and apply them.

if ( apply_filters('envira_whitelabel', false )  ):

	add_filter( 'envira_whitelabel_name',			'example_envira_whitelabel_name' );
	add_filter( 'envira_whitelabel_name_singular',	'example_envira_whitelabel_name' );
	add_filter( 'envira_whitelabel_name_plural',	'example_envira_whitelabel_name_plural' );
	function example_envira_whitelabel_name() {
		return 'Gallery';
	}
	function example_envira_whitelabel_name_plural() {
		return 'Galleries';
	}

	// actions (Envira):
	// envira_whitelabel_header_logo
	// envira_whitelabel_default_display
	// envira_whitelabel_tab_text_images
	// envira_whitelabel_tab_text_config
	// envira_whitelabel_tab_text_lightbox
	// envira_whitelabel_tab_text_mobile
	// envira_whitelabel_tab_text_misc

	// filters (Albums):
	add_filter( 'envira_album_whitelabel_name', 			'example_envira_album_whitelabel_name' );
	add_filter( 'envira_album_whitelabel_name_singular', 	'example_envira_album_whitelabel_name' );
	add_filter( 'envira_album_whitelabel_name_plural', 		'example_envira_album_whitelabel_name_plural' );
	function example_envira_album_whitelabel_name() {
		return 'Album';
	}
	function example_envira_album_whitelabel_name_plural() {
		return 'Albums';
	}

	// actions (Albums):
	// envira_album_whitelabel_text_available_galleries
	// envira_album_whitelabel_text_settings
	// envira_album_whitelabel_lightbox_settings

	// actions (Standalone):
	// envira_standalone_whitelabel_tab_helptext

	// actions (Addons):
	// envira_instagram_whitelabel_tab_helptext
	// envira_watermarking_whitelabel_tab_helptext
	// envira_tags_whitelabel_tab_helptext
	// envira_social_whitelabel_tab_helptext
	// envira_social_lightbox_whitelabel_tab_helptext

	// Example:
	function example_envira_instagram_whitelabel_tab_helptext() {
		echo 'custom text here';
	}	
	add_action( 'envira_instagram_whitelabel_tab_helptext',	'example_envira_instagram_whitelabel_tab_helptext' );

	// filters (Misc):

	// this filter controls if you want the addon menu displayed in WordPress backend (default false)
	add_filter( 'envira_whitelabel_addon_screen',	'example_envira_whitelabel_addon_screen' );
	function example_envira_whitelabel_addon_screen() {
		return true; // make this true if you want to show the addon screen when whitelabel is active
	}

endif;

That’s it! You’ve whitelabeled Envira Gallery. Now that this is done, you may want to customize even further by adding a featured image for albums and galleries.

Share This Post!