diff --git a/projects/plugins/jetpack/changelog/fix-remove-inline-style-theme-color-for-subscriptions b/projects/plugins/jetpack/changelog/fix-remove-inline-style-theme-color-for-subscriptions new file mode 100644 index 0000000000000..1579acbde77e2 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-remove-inline-style-theme-color-for-subscriptions @@ -0,0 +1,4 @@ +Significance: patch +Type: bugfix + +Subscriptions Block: allow block to override color styles, falling back to theme defaults. diff --git a/projects/plugins/jetpack/modules/subscriptions/views.php b/projects/plugins/jetpack/modules/subscriptions/views.php index 1cda856072143..77d249eb289b6 100644 --- a/projects/plugins/jetpack/modules/subscriptions/views.php +++ b/projects/plugins/jetpack/modules/subscriptions/views.php @@ -210,43 +210,39 @@ static function render_widget_status_messages( $instance ) { if ( self::is_wpcom() && self::wpcom_has_status_message() ) { global $themecolors; + $message = ''; + switch ( $_GET['blogsub'] ) { case 'confirming': - echo "
"; - _e( 'Thanks for subscribing! You’ll get an email with a link to confirm your subscription. If you don’t get it, please contact us.' ); - echo "
"; + $message = __( 'Thanks for subscribing! You’ll get an email with a link to confirm your subscription. If you don’t get it, please contact us.', 'jetpack' ); break; case 'blocked': - echo "
"; - _e( 'Subscriptions have been blocked for this email address.' ); - echo "
"; + $message = __( 'Subscriptions have been blocked for this email address.', 'jetpack' ); break; case 'flooded': - echo "
"; - _e( 'You already have several pending email subscriptions. Approve or delete a few through your Subscription Manager before attempting to subscribe to more blogs.' ); - echo "
"; + $message = __( 'You already have several pending email subscriptions. Approve or delete a few through your Subscription Manager before attempting to subscribe to more blogs.', 'jetpack' ); break; case 'spammed': - echo "
"; - echo wp_kses_post( sprintf( __( 'Because there are many pending subscriptions for this email address, we have blocked the subscription. Please activate or delete pending subscriptions before attempting to subscribe.' ), 'https://subscribe.wordpress.com/' ) ); - echo "
"; + /* translators: %s is a URL */ + $message = sprintf( __( 'Because there are many pending subscriptions for this email address, we have blocked the subscription. Please activate or delete pending subscriptions before attempting to subscribe.', 'jetpack' ), 'https://subscribe.wordpress.com/' ); break; case 'subscribed': - echo "
"; - _e( 'You’re already subscribed to this site.' ); - echo "
"; + $message = __( 'You’re already subscribed to this site.', 'jetpack' ); break; case 'pending': - echo "
"; - _e( 'You have a pending subscription already; we just sent you another email. Click the link or contact us if you don’t receive it.' ); - echo "
"; + $message = __( 'You have a pending subscription already; we just sent you another email. Click the link or contact us if you don’t receive it.', 'jetpack' ); break; case 'confirmed': - echo "
"; - _e( 'Congrats, you’re subscribed! You’ll get an email with the details of your subscription and an unsubscribe link.' ); - echo "
"; + $message = __( 'Congrats, you’re subscribed! You’ll get an email with the details of your subscription and an unsubscribe link.', 'jetpack' ); break; } + + $border_color = isset( $themecolors['border'] ) ? " #{$themecolors['border']}" : ''; + printf( + '
%2$s
', + esc_attr( $border_color ), + wp_kses_post( $message ) + ); } }