Untitled

Anonymous
plain_text
07/05/2026 6:17 PM
2.0 KB
39
Indexable
/**
 * [woo_notices] — prints the registration-pending notice when ?redir=1 is in the URL.
 */
function pbs_woo_notices_shortcode() {
	// Only do something when the redirect flag is present.
	if ( ! isset( $_GET['redir'] ) || '1' !== $_GET['redir'] ) {
		return '';
	}

	// Need WooCommerce's notice printer.
	if ( ! function_exists( 'wc_print_notice' ) ) {
		return '';
	}

	$message = apply_filters(
		'b2bking_registration_manual_approval_message',
		get_option(
			'b2bking_approval_pending_frontend_text_setting',
			esc_html__( 'Thank you for registering. Your account requires manual approval. Please wait to be approved.', 'b2bking' )
		),
		'success'
	);
	if (empty($message)){
		$message = 'Thank you for registering. Your account requires manual approval. Please wait to be approved.';
	}

	// wc_print_notice() echoes, so buffer it and return.
	ob_start();
	wc_print_notice( $message, 'success' );
	return ob_get_clean();
}
add_shortcode( 'woo_notices', 'pbs_woo_notices_shortcode' );
add_action('wp_head', function(){
	?>
	<style>
		.woocommerce-account .woocommerce-message {
			color: #3f3f3f !important;
			border: 1px solid #ccc;
		}
		.b2bking_custom_registration_container input {
			-webkit-appearance: none;
			background-color: #eee;
			max-width: 100%;
			border-width: 0;
			border-radius: 0;
			color: #999;
			font-size: 14px;
			padding: 16px;
			line-height: 1.7em;
			border-style: solid;
		}
		.b2bking_custom_registration_container .select2-container.select2-selection--single{
			height: auto !important;
		}
	</style>
	<?php
});
Editor is loading...
Leave a Comment