authorizer icon indicating copy to clipboard operation
authorizer copied to clipboard

Feature request: custom branding as a multisite option

Open oldfieldtc opened this issue 1 year ago • 3 comments

For multisites, would it be possible to change the 'Custom WordPress login branding' option to be a multisite option instead of being per individual site? We've got a lot of sites under our multisite and it would be a huge help if I could change the branding in one place rather than set the option on every site!

Thanks

oldfieldtc avatar Oct 08 '24 11:10 oldfieldtc

Would it be ok to add a filter to specify which branding option to choose, and that would override whatever is set in Authorizer settings on the individual subsites? Something like:

add_filter( 'authorizer_advanced_branding', function ( $advanced_branding, $branding_options ) {
	// Make sure the custom branding option exists in the list of branding options
	// before using it.
	if ( ! empty( array_filter( $branding_options, function( $branding_option ) { return ! empty( $branding_option['value'] ) && 'your-global-branding-option' === $branding_option['value']; } ) ) ) {
		$advanced_branding = 'your-global-branding-option';
	}

	return $advanced_branding;
} );

We can also add a wp-config.php constant, something like AUTHORIZER_ADVANCED_BRANDING that would do the same.

I think that's easier for us to implement instead of trying to handle folks that want custom branding on each subsite vs. consistent branding across all subsites.

figureone avatar Oct 14 '24 20:10 figureone

That could work! Happy to test this out if this gets added to a branch

oldfieldtc avatar Oct 15 '24 13:10 oldfieldtc

Aloha, we have added a filter and constant for this feature: https://github.com/uhm-coe/authorizer/commit/0540d729cda31a6b7979513e8cfe84c08fe0ce2a

We've updated the code sample above to match the names and params used in the commit above.

This will be included with the next release, but we don’t have a scheduled date for that, so feel free to use the commit above to modify your local copy if you want to get the feature earlier. Let us know if you run into any issues

figureone avatar Mar 25 '25 00:03 figureone