Skip to content

Commit

Permalink
Merge pull request #3298 from Automattic/trunk
Browse files Browse the repository at this point in the history
Alpha release Aug 01
  • Loading branch information
adekbadek authored Aug 1, 2024
2 parents a2700ea + aebe581 commit 3cbc6ce
Show file tree
Hide file tree
Showing 11 changed files with 965 additions and 441 deletions.
68 changes: 68 additions & 0 deletions assets/other-scripts/co-authors-plus/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* globals guestAuthorRole, jQuery */

jQuery( document ).ready( function ( $ ) {
$( 'select#role' ).change( function () {
if ( guestAuthorRole.role !== $( this ).val() ) {
deactivateGuestAuthor();
} else {
activateGuestAuthor();
}
} );

const loginLabel = $( 'label[for="user_login"]' )[ 0 ].innerHTML;

function activateGuestAuthor() {
// Make email not required.
$( 'label[for="email"] > span.description' ).hide();
$( '#createuser input[name=email]' ).closest( 'tr' ).removeClass( 'form-required' );

// User login.
if ( 'new' === guestAuthorRole.screen ) {
$( 'label[for="user_login"]' )[ 0 ].innerHTML = guestAuthorRole.displayNameLabel;
} else {
$( 'label[for="user_login"]' ).parents( 'tr' ).hide();
}

// Password.
$( 'label[for="pass1"]' ).parents( 'tr' ).hide();

// Email notification.
$( 'input#send_user_notification' ).parents( 'tr' ).hide();

// User profile fields.
$( 'label[for="rich_editing"]' ).parents( 'tr' ).hide();
$( 'label[for="comment_shortcuts"]' ).parents( 'tr' ).hide();
$( 'label[for="admin_bar_front"]' ).parents( 'tr' ).hide();
$( 'label[for="locale"]' ).parents( 'tr' ).hide();
$( 'tr.user-admin-color-wrap' ).hide();
}

function deactivateGuestAuthor() {
// Make email required.
$( 'label[for="email"] > span.description' ).show();
$( '#createuser input[name=email]' ).closest( 'tr' ).addClass( 'form-required' );

// User login.
if ( 'new' === guestAuthorRole.screen ) {
$( 'label[for="user_login"]' )[ 0 ].innerHTML = loginLabel;
} else {
$( 'label[for="user_login"]' ).parents( 'tr' ).show();
}

// Password.
$( 'label[for="pass1"]' ).parents( 'tr' ).show();

// Email notification.
$( 'input#send_user_notification' ).parents( 'tr' ).show();

// User profile fields.
$( 'label[for="rich_editing"]' ).parents( 'tr' ).show();
$( 'label[for="comment_shortcuts"]' ).parents( 'tr' ).show();
$( 'label[for="admin_bar_front"]' ).parents( 'tr' ).show();
$( 'label[for="locale"]' ).parents( 'tr' ).show();
$( 'tr.user-admin-color-wrap' ).show();
}

// Trigger change event on page load.
$( 'select#role' ).change();
} );
14 changes: 13 additions & 1 deletion assets/wizards/engagement/views/newsletters/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import once from 'lodash/once';
import { useEffect, useState, Fragment } from '@wordpress/element';
import apiFetch from '@wordpress/api-fetch';
import { sprintf, __ } from '@wordpress/i18n';
import { CheckboxControl, TextareaControl, ExternalLink } from '@wordpress/components';
import { CheckboxControl, TextareaControl, ExternalLink, Notice } from '@wordpress/components';

/**
* Internal dependencies
Expand Down Expand Up @@ -188,6 +188,18 @@ export const NewspackNewsletters = ( {
</Button>
</Card>
) }
{ 'campaign_monitor' ===
config?.settings?.newspack_newsletters_service_provider?.value && (
<Notice status="warning" isDismissible={ false }>
<h2>{ __( 'Campaign Monitor support will be deprecated', 'newspack-plugin' ) }</h2>
<p>
{ __(
'Please connect a different service provider to ensure continued support.',
'newspack-'
) }
</p>
</Notice>
) }
{ values( config.settings )
.filter(
setting => ! setting.provider || setting.provider === providerSelectProps.value
Expand Down
1 change: 1 addition & 0 deletions includes/class-newspack.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ private function includes() {
include_once NEWSPACK_ABSPATH . 'includes/plugins/class-perfmatters.php';
include_once NEWSPACK_ABSPATH . 'includes/plugins/class-co-authors-plus.php';
include_once NEWSPACK_ABSPATH . 'includes/plugins/wc-memberships/class-memberships.php';
include_once NEWSPACK_ABSPATH . 'includes/plugins/class-woocommerce.php';

include_once NEWSPACK_ABSPATH . 'includes/class-patches.php';
include_once NEWSPACK_ABSPATH . 'includes/polyfills/class-amp-polyfills.php';
Expand Down
7 changes: 6 additions & 1 deletion includes/data-events/connectors/ga4/class-ga4.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,12 @@ function( $category ) {
}
}

return $params;
/**
* Filters the custom parameters passed to GA4.
*
* @param array $params Custom parameters sent to GA4.
*/
return apply_filters( 'newspack_ga4_custom_parameters', $params );
}

/**
Expand Down
Loading

0 comments on commit 3cbc6ce

Please sign in to comment.